Skip to content

Commit

Permalink
Fix invalid version string "9999999.9999999"
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas-grekas committed Oct 7, 2024
1 parent 33ce7c1 commit 543443a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
"symfony/phpunit-bridge": "^4.4.12|^5.0|^6.0",
"symfony/process": "^4.4|^5.0|^6.0"
},
"conflict": {
"composer/semver": "<1.7.2"
},
"autoload": {
"psr-4": {
"Symfony\\Flex\\": "src"
Expand Down
4 changes: 4 additions & 0 deletions src/Flex.php
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,10 @@ public function recordOperations(InstallerEvent $event)
$versionParser = new VersionParser();
$packages = [];
foreach ($this->lock->all() as $name => $info) {
if ('9999999.9999999' === $info['version']) {
// Fix invalid versions found in some lock files
$info['version'] = '99999.9999999';
}
$packages[] = new Package($name, $versionParser->normalize($info['version']), $info['version']);
}

Expand Down

0 comments on commit 543443a

Please sign in to comment.