bug #17526 Escape the delimiter in Glob::toRegex (javiereguiluz)
This PR was submitted for the 2.7 branch but it was merged into the 2.3 branch instead (closes #17526).
Discussion
----------
Escape the delimiter in Glob::toRegex
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #13531
| License | MIT
| Doc PR | -
Commits
-------
2c45f46
Escape the delimiter in Glob::toRegex
This commit is contained in:
commit
ff4b815fdf
@ -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