Force-collapse multiple slashes into one, fixes #5387

main
Jordi Boggiano 8 years ago
parent 43273c4366
commit c289776d94

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

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

Loading…
Cancel
Save