瀏覽代碼

Fix exclude-from-classmap when a package is installed as a symlink, fixes #6397

Jordi Boggiano 7 年之前
父節點
當前提交
bf940fb21b
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      src/Composer/Autoload/ClassMapGenerator.php

+ 2 - 1
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;
             }