Skip to content

Commit c372816

Browse files
authored
Merge pull request #379 from greg0ire/preg_quote
Quote path placeholder for use with PCRE
2 parents c2290ac + 432f257 commit c372816

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Command/DoctrineCommand.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
use function is_dir;
1818
use function mkdir;
1919
use function preg_match;
20+
use function preg_quote;
2021
use function sprintf;
2122
use function str_replace;
2223

@@ -48,7 +49,7 @@ public static function configureMigrations(ContainerInterface $container, Config
4849
$pathPlaceholderArray = ['kernel.root_dir', 'kernel.cache_dir', 'kernel.logs_dir'];
4950

5051
foreach ($pathPlaceholderArray as $pathPlaceholder) {
51-
if (! $container->hasParameter($pathPlaceholder) || preg_match('/\%' . $pathPlaceholder . '\%/', $dir) === 0) {
52+
if (! $container->hasParameter($pathPlaceholder) || preg_match('/\%' . preg_quote($pathPlaceholder) . '\%/', $dir) === 0) {
5253
continue;
5354
}
5455

0 commit comments

Comments
 (0)