From 90a6aa7ec0937c068b8d8ae5dd3900685dbb8990 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Tue, 27 Oct 2020 21:04:00 +0100 Subject: [PATCH] Make sure we compare packages to their latest without aliases, fixes #9357 --- src/Composer/Command/ShowCommand.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Composer/Command/ShowCommand.php b/src/Composer/Command/ShowCommand.php index a1a5ffc8b22e..b77853d23492 100644 --- a/src/Composer/Command/ShowCommand.php +++ b/src/Composer/Command/ShowCommand.php @@ -1227,7 +1227,12 @@ private function findLatestPackage(PackageInterface $package, Composer $composer $targetVersion = '^' . $package->getVersion(); } - return $versionSelector->findBestCandidate($name, $targetVersion, $bestStability); + $candidate = $versionSelector->findBestCandidate($name, $targetVersion, $bestStability); + while ($candidate instanceof AliasPackage) { + $candidate = $candidate->getAliasOf(); + } + + return $candidate; } private function getRepositorySet(Composer $composer)