Jordi Boggiano преди 13 години
родител
ревизия
a19695cdcb
променени са 1 файла, в които са добавени 3 реда и са изтрити 3 реда
  1. 3 3
      src/Composer/Downloader/Util/Filesystem.php

+ 3 - 3
src/Composer/Downloader/Util/Filesystem.php

@@ -61,12 +61,12 @@ class Filesystem
         $from = rtrim(strtr($from, '\\', '/'), '/');
         $to = rtrim(strtr($to, '\\', '/'), '/');
 
-        $commonPath = dirname($to);
-        while (strpos($from, $commonPath) !== 0 && '/' !== $commonPath && !preg_match('{^[a-z]:/$}i', $commonPath)) {
+        $commonPath = strtr(dirname($to), '\\', '/');
+        while (strpos($from, $commonPath) !== 0 && '/' !== $commonPath && !preg_match('{^[a-z]:/?$}i', $commonPath) && '.' !== $commonPath) {
             $commonPath = strtr(dirname($commonPath), '\\', '/');
         }
 
-        if (0 !== strpos($from, $commonPath) || '/' === $commonPath) {
+        if (0 !== strpos($from, $commonPath) || '/' === $commonPath || '.' === $commonPath) {
             return $to;
         }