mirror of
https://github.com/danog/psalm.git
synced 2025-01-22 05:41:20 +01:00
bugfix: quote regular expression
Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
This commit is contained in:
parent
3e1be794c4
commit
a050ff2878
@ -50,6 +50,7 @@ use function get_class;
|
||||
use function max;
|
||||
use function min;
|
||||
use function preg_match;
|
||||
use function preg_quote;
|
||||
use function sprintf;
|
||||
use function str_replace;
|
||||
use function strpos;
|
||||
@ -2419,7 +2420,7 @@ class SimpleAssertionReconciler extends \Psalm\Type\Reconciler
|
||||
return $existing_type;
|
||||
}
|
||||
|
||||
$constant_regex_pattern = sprintf('#^%s$#', str_replace('*', '.*', $constant_pattern));
|
||||
$constant_regex_pattern = sprintf('#^%s$#', preg_quote(str_replace('*', '.*', $constant_pattern), '#'));
|
||||
|
||||
$class_like_storage = $codebase->classlike_storage_provider->get($class_name);
|
||||
$matched_class_constant_types = [];
|
||||
|
Loading…
x
Reference in New Issue
Block a user