Skip to content

Commit f036818

Browse files
committed
Merge branch '2.7' into 2.8
* 2.7: Increase the inlining YAML level for config:debug [Serializer] Minor: fix CS and PHPDoc [Form] fix tests [Serializer] Ensure that groups are strings [Debug] Tell that the extension is for PHP 5 only Static code analysis Update AnnotationDirectoryLoader.php added a test Escape the delimiter in Glob::toRegex [FrameworkBundle] Fix template location for PHP templates [FrameworkBundle] Add path verification to the template parsing test cases
2 parents fc7a785 + 67f8de5 commit f036818

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

Adapter/AbstractFindAdapter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public function searchInDirectory($dir)
9898
$command->setErrorHandler(
9999
$this->ignoreUnreadableDirs
100100
// If directory is unreadable and finder is set to ignore it, `stderr` is ignored.
101-
? function ($stderr) { return; }
101+
? function ($stderr) { }
102102
: function ($stderr) { throw new AccessDeniedException($stderr); }
103103
);
104104

Glob.php

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

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

Tests/GlobTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ class GlobTest extends \PHPUnit_Framework_TestCase
1717
{
1818
public function testGlobToRegexDelimiters()
1919
{
20+
$this->assertEquals('#^(?=[^\.])\#$#', Glob::toRegex('#'));
2021
$this->assertEquals('#^\.[^/]*$#', Glob::toRegex('.*'));
2122
$this->assertEquals('^\.[^/]*$', Glob::toRegex('.*', true, true, ''));
2223
$this->assertEquals('/^\.[^/]*$/', Glob::toRegex('.*', true, true, '/'));

0 commit comments

Comments
 (0)