1
0
Fork 0

Also remove credentials from cache dirs in git/svn drivers, fixes #7439, refs #9155

pull/9161/head
Jordi Boggiano 2020-08-27 10:19:23 +02:00
parent 98862f5408
commit c3db4614c9
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
2 changed files with 4 additions and 2 deletions

View File

@ -14,6 +14,7 @@ namespace Composer\Repository\Vcs;
use Composer\Util\ProcessExecutor;
use Composer\Util\Filesystem;
use Composer\Util\Url;
use Composer\Util\Git as GitUtil;
use Composer\IO\IOInterface;
use Composer\Cache;
@ -74,7 +75,7 @@ class GitDriver extends VcsDriver
$this->getTags();
$this->getBranches();
$this->cache = new Cache($this->io, $this->config->get('cache-repo-dir').'/'.preg_replace('{[^a-z0-9.]}i', '-', $cacheUrl));
$this->cache = new Cache($this->io, $this->config->get('cache-repo-dir').'/'.preg_replace('{[^a-z0-9.]}i', '-', Url::sanitize($cacheUrl)));
$this->cache->setReadOnly($this->config->get('cache-read-only'));
}

View File

@ -17,6 +17,7 @@ use Composer\Config;
use Composer\Json\JsonFile;
use Composer\Util\ProcessExecutor;
use Composer\Util\Filesystem;
use Composer\Util\Url;
use Composer\Util\Svn as SvnUtil;
use Composer\IO\IOInterface;
use Composer\Downloader\TransportException;
@ -77,7 +78,7 @@ class SvnDriver extends VcsDriver
$this->baseUrl = substr($this->url, 0, $pos);
}
$this->cache = new Cache($this->io, $this->config->get('cache-repo-dir').'/'.preg_replace('{[^a-z0-9.]}i', '-', $this->baseUrl));
$this->cache = new Cache($this->io, $this->config->get('cache-repo-dir').'/'.preg_replace('{[^a-z0-9.]}i', '-', Url::sanitize($this->baseUrl)));
$this->cache->setReadOnly($this->config->get('cache-read-only'));
$this->getBranches();