Skip to content

Commit

Permalink
bug #1029 Fix invalid version string "9999999.9999999" (nicolas-grekas)
Browse files Browse the repository at this point in the history
This PR was merged into the 1.x branch.

Discussion
----------

Fix invalid version string "9999999.9999999"

Fix #887
Fix #983
Fix #1016

Commits
-------

543443a Fix invalid version string "9999999.9999999"
  • Loading branch information
nicolas-grekas committed Oct 7, 2024
2 parents 33ce7c1 + 543443a commit bda5f86
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 bda5f86

Please sign in to comment.