From 543443a6faba6a3c88079c2b51a6f7e72880795b Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Mon, 7 Oct 2024 10:32:25 +0200 Subject: [PATCH] Fix invalid version string "9999999.9999999" --- composer.json | 3 +++ src/Flex.php | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/composer.json b/composer.json index 9fbe22c3d..66e150798 100644 --- a/composer.json +++ b/composer.json @@ -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" diff --git a/src/Flex.php b/src/Flex.php index a45ce90df..30be50649 100644 --- a/src/Flex.php +++ b/src/Flex.php @@ -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']); }