Skip to content

Commit ff4b815

Browse files
committed
bug symfony#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 symfony#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 | symfony#13531 | License | MIT | Doc PR | - Commits ------- 2c45f46 Escape the delimiter in Glob::toRegex
2 parents ca96e33 + 2c45f46 commit ff4b815

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Symfony/Component/Finder/Glob.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public static function toRegex($glob, $strictLeadingDot = true, $strictWildcardS
6565
$firstByte = true;
6666
}
6767

68-
if ('.' === $car || '(' === $car || ')' === $car || '|' === $car || '+' === $car || '^' === $car || '$' === $car) {
68+
if ($delimiter === $car || '.' === $car || '(' === $car || ')' === $car || '|' === $car || '+' === $car || '^' === $car || '$' === $car) {
6969
$regex .= "\\$car";
7070
} elseif ('*' === $car) {
7171
$regex .= $escaping ? '\\*' : ($strictWildcardSlash ? '[^/]*' : '.*');

0 commit comments

Comments
 (0)