1
0
Fork 0

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

pull/6651/merge
Jordi Boggiano 2017-09-11 11:26:33 +02:00
parent b859bbcdcf
commit 8b61315b14
1 changed files with 4 additions and 0 deletions

View File

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