Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow underscores in cache keys to avoid conflicts with package names containing underscore vs dashes #11229

Merged
merged 1 commit into from
Dec 17, 2022

Conversation

Seldaek
Copy link
Member

@Seldaek Seldaek commented Dec 17, 2022

fixes #11224

@glaubinix
Copy link
Contributor

Thank you! Confirming that the issue has been resolved with this PR.

@@ -175,7 +175,7 @@ public function __construct(array $repoConfig, IOInterface $io, Config $config,
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.$~_');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't this also update the regex ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is mostly to normalize the domain and url path. Domain can't contain underscore and path to the packages.json is also not really relevant here I think.

emahorvat52 pushed a commit to emahorvat52/composer that referenced this pull request Feb 3, 2023
@Seldaek Seldaek deleted the fix_cache_allowlist branch February 4, 2023 13:43
Seldaek added a commit that referenced this pull request Feb 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Composer repository cache for two packages can write to the same cache file
3 participants