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'; }