From 2a3b56e82cf334b65d21d6554d669dc4b53a1d92 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Thu, 28 Apr 2016 22:25:53 +0100 Subject: [PATCH] Fix constraint parsing bug in outdated, fixes #5251 --- src/Composer/Command/ShowCommand.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Composer/Command/ShowCommand.php b/src/Composer/Command/ShowCommand.php index 8c112fe87..0d1f2b57b 100644 --- a/src/Composer/Command/ShowCommand.php +++ b/src/Composer/Command/ShowCommand.php @@ -385,7 +385,11 @@ EOT return 'info'; } - if ($latestPackage->getVersion() && Semver::satisfies($latestPackage->getVersion(), '^'.$package->getVersion())) { + $constraint = $package->getVersion(); + if (0 !== strpos($constraint, 'dev-')) { + $constraint = '^'.$constraint; + } + if ($latestPackage->getVersion() && Semver::satisfies($latestPackage->getVersion(), $constraint)) { // print red as it needs an immediate semver-compliant upgrade return 'highlight'; }