From 8b61315b14bef09cf39b545a897d0090ce6cf94c Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Mon, 11 Sep 2017 11:26:33 +0200 Subject: [PATCH] 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 --- src/Composer/Downloader/PathDownloader.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Composer/Downloader/PathDownloader.php b/src/Composer/Downloader/PathDownloader.php index 77ca0bb13..250a01c3f 100644 --- a/src/Composer/Downloader/PathDownloader.php +++ b/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);