[ticket/11150] Better version normalization

PHPBB3-11150
This commit is contained in:
Tristan Darricau 2015-09-10 13:11:55 +02:00 committed by Tristan Darricau
parent ac129f34d3
commit 540bac3ba4
No known key found for this signature in database
GPG key ID: 817043C2E29DB881
2 changed files with 9 additions and 2 deletions

View file

@ -118,7 +118,6 @@ class installer
// TODO Extract the precise error and use language string // TODO Extract the precise error and use language string
throw new \RuntimeException(substr($output, $error_pos)); throw new \RuntimeException(substr($output, $error_pos));
} }
} }
catch (\Exception $e) catch (\Exception $e)
{ {

View file

@ -190,9 +190,17 @@ class manager implements manager_interface
foreach ($packages as $package => $version) foreach ($packages as $package => $version)
{ {
if (is_numeric($package)) if (is_numeric($package))
{
if (strpos($version, ':') !== false)
{
$parts = explode(':', $version);
$normalized_packages[$parts[0]] = $parts[1];
}
else
{ {
$normalized_packages[$version] = '*'; $normalized_packages[$version] = '*';
} }
}
else else
{ {
$normalized_packages[$package] = $version; $normalized_packages[$package] = $version;