diff --git a/src/Composer/Cache.php b/src/Composer/Cache.php index 4e1fa7429..1a216c592 100644 --- a/src/Composer/Cache.php +++ b/src/Composer/Cache.php @@ -47,7 +47,7 @@ class Cache * @param Filesystem $filesystem optional filesystem instance * @param bool $readOnly whether the cache is in readOnly mode */ - public function __construct(IOInterface $io, string $cacheDir, string $allowlist = 'a-z0-9.', ?Filesystem $filesystem = null, bool $readOnly = false) + public function __construct(IOInterface $io, string $cacheDir, string $allowlist = 'a-z0-9._', ?Filesystem $filesystem = null, bool $readOnly = false) { $this->io = $io; $this->root = rtrim($cacheDir, '/\\') . '/'; diff --git a/src/Composer/Repository/ComposerRepository.php b/src/Composer/Repository/ComposerRepository.php index fa9ac4c54..a3442720f 100644 --- a/src/Composer/Repository/ComposerRepository.php +++ b/src/Composer/Repository/ComposerRepository.php @@ -175,7 +175,7 @@ class ComposerRepository extends ArrayRepository implements ConfigurableReposito assert($baseUrl !== ''); $this->baseUrl = $baseUrl; $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);