Ver código fonte

Normalize URL as symfony Filesystem::mirror does a straight str_replace on realUrl vs actual iteratee path without normalization and our aRchivableFilesFinder does normalize the path, refs #6667

Jordi Boggiano 7 anos atrás
pai
commit
8b61315b14
1 arquivos alterados com 4 adições e 0 exclusões
  1. 4 0
      src/Composer/Downloader/PathDownloader.php

+ 4 - 0
src/Composer/Downloader/PathDownloader.php

@@ -19,6 +19,7 @@ use Composer\Package\Version\VersionGuesser;
 use Composer\Package\Version\VersionParser;
 use Composer\Util\Platform;
 use Composer\Util\ProcessExecutor;
+use Composer\Util\Filesystem as ComposerFilesystem;
 use Symfony\Component\Filesystem\Exception\IOException;
 use Symfony\Component\Filesystem\Filesystem;
 
@@ -119,6 +120,9 @@ class PathDownloader extends FileDownloader implements VcsCapableDownloaderInter
 
         // Fallback if symlink failed or if symlink is not allowed for the package
         if (self::STRATEGY_MIRROR == $currentStrategy) {
+            $fs = new ComposerFilesystem();
+            $realUrl = $fs->normalizePath($realUrl);
+
             $this->io->writeError(sprintf('%sMirroring from %s', $isFallback ? '    ' : '', $url), false);
             $iterator = new ArchivableFilesFinder($realUrl, array());
             $fileSystem->mirror($realUrl, $path, $iterator);