Escape the delimiter in Glob::toRegex
This commit is contained in:
parent
ca96e334b4
commit
2c45f461c2
@ -65,7 +65,7 @@ class Glob
|
|||||||
$firstByte = true;
|
$firstByte = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ('.' === $car || '(' === $car || ')' === $car || '|' === $car || '+' === $car || '^' === $car || '$' === $car) {
|
if ($delimiter === $car || '.' === $car || '(' === $car || ')' === $car || '|' === $car || '+' === $car || '^' === $car || '$' === $car) {
|
||||||
$regex .= "\\$car";
|
$regex .= "\\$car";
|
||||||
} elseif ('*' === $car) {
|
} elseif ('*' === $car) {
|
||||||
$regex .= $escaping ? '\\*' : ($strictWildcardSlash ? '[^/]*' : '.*');
|
$regex .= $escaping ? '\\*' : ($strictWildcardSlash ? '[^/]*' : '.*');
|
||||||
|
Reference in New Issue
Block a user