Skip to content

Commit f11a92e

Browse files
committed
Add quoting for base path in DI compile command
1 parent ce3efb6 commit f11a92e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

setup/src/Magento/Setup/Console/Command/DiCompileCommand.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ private function getExcludedModulePaths(array $modulePaths)
221221
$vendorPathsRegExps[] = $vendorDir
222222
. '/(?:' . join('|', $vendorModules) . ')';
223223
}
224-
$basePathsRegExps[] = $basePath
224+
$basePathsRegExps[] = preg_quote($basePath, '#')
225225
. '/(?:' . join('|', $vendorPathsRegExps) . ')';
226226
}
227227

@@ -240,6 +240,10 @@ private function getExcludedModulePaths(array $modulePaths)
240240
*/
241241
private function getExcludedLibraryPaths(array $libraryPaths)
242242
{
243+
$libraryPaths = array_map(function ($libraryPath) {
244+
return preg_quote($libraryPath, '#');
245+
}, $libraryPaths);
246+
243247
$excludedLibraryPaths = [
244248
'#^(?:' . join('|', $libraryPaths) . ')/([\\w]+/)?Test#',
245249
'#^(?:' . join('|', $libraryPaths) . ')/([\\w]+/)?tests#',

0 commit comments

Comments
 (0)