From bf940fb21b0dcc830e8c8430a3cc9d7f3ac607c0 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Sun, 6 Aug 2017 17:21:04 +0200 Subject: [PATCH] Fix exclude-from-classmap when a package is installed as a symlink, fixes #6397 --- src/Composer/Autoload/ClassMapGenerator.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Composer/Autoload/ClassMapGenerator.php b/src/Composer/Autoload/ClassMapGenerator.php index d4d2b0b6e..649c700c8 100644 --- a/src/Composer/Autoload/ClassMapGenerator.php +++ b/src/Composer/Autoload/ClassMapGenerator.php @@ -90,7 +90,8 @@ class ClassMapGenerator $filePath = preg_replace('{[\\\\/]{2,}}', '/', $filePath); } - if ($blacklist && preg_match($blacklist, strtr($filePath, '\\', '/'))) { + // check the realpath of the file against the blacklist as the path might be a symlink and the blacklist is realpath'd so symlink are resolved + if ($blacklist && preg_match($blacklist, strtr(realpath($filePath), '\\', '/'))) { continue; }