Allow underscores in cache keys to avoid conflicts with package names containing underscore vs dashes, fixes #11224 (#11229)
parent
ef21de5232
commit
bf451bd089
|
@ -48,7 +48,7 @@ class Cache
|
|||
* @param Filesystem $filesystem optional filesystem instance
|
||||
* @param bool $readOnly whether the cache is in readOnly mode
|
||||
*/
|
||||
public function __construct(IOInterface $io, $cacheDir, $allowlist = 'a-z0-9.', Filesystem $filesystem = null, $readOnly = false)
|
||||
public function __construct(IOInterface $io, $cacheDir, $allowlist = 'a-z0-9._', Filesystem $filesystem = null, $readOnly = false)
|
||||
{
|
||||
$this->io = $io;
|
||||
$this->root = rtrim($cacheDir, '/\\') . '/';
|
||||
|
|
|
@ -168,7 +168,7 @@ class ComposerRepository extends ArrayRepository implements ConfigurableReposito
|
|||
|
||||
$this->baseUrl = rtrim(Preg::replace('{(?:/[^/\\\\]+\.json)?(?:[?#].*)?$}', '', $this->url), '/');
|
||||
$this->io = $io;
|
||||
$this->cache = new Cache($io, $config->get('cache-repo-dir').'/'.Preg::replace('{[^a-z0-9.]}i', '-', Url::sanitize($this->url)), 'a-z0-9.$~');
|
||||
$this->cache = new Cache($io, $config->get('cache-repo-dir').'/'.Preg::replace('{[^a-z0-9.]}i', '-', Url::sanitize($this->url)), 'a-z0-9.$~_');
|
||||
$this->cache->setReadOnly($config->get('cache-read-only'));
|
||||
$this->versionParser = new VersionParser();
|
||||
$this->loader = new ArrayLoader($this->versionParser);
|
||||
|
|
Loading…
Reference in New Issue