1
0
Fork 0

Force-collapse multiple slashes into one, fixes #5387

pull/5383/merge
Jordi Boggiano 2016-05-31 19:37:26 +01:00
parent 43273c4366
commit c289776d94
2 changed files with 3 additions and 1 deletions

View File

@ -810,7 +810,7 @@ INITIALIZER;
if ($type === 'exclude-from-classmap') {
// first escape user input
$path = preg_quote(trim(strtr($path, '\\', '/'), '/'));
$path = preg_replace('{/+}', '/', preg_quote(trim(strtr($path, '\\', '/'), '/')));
// add support for wildcards * and **
$path = str_replace('\\*\\*', '.+?', $path);

View File

@ -86,6 +86,8 @@ class ClassMapGenerator
if (!$filesystem->isAbsolutePath($filePath)) {
$filePath = $cwd . '/' . $filePath;
$filePath = $filesystem->normalizePath($filePath);
} else {
$filePath = preg_replace('{[\\\\/]{2,}}', '/', $filePath);
}
if ($blacklist && preg_match($blacklist, strtr($filePath, '\\', '/'))) {