1
0
Fork 0

Avoid relying on internal usort behavior

pull/7280/head
Jordi Boggiano 2018-04-13 14:09:00 +02:00
parent c917865fe9
commit ef7252b358
1 changed files with 4 additions and 0 deletions

View File

@ -70,6 +70,10 @@ class VersionParser extends SemverVersionParser
*/
public static function isUpgrade($normalizedFrom, $normalizedTo)
{
if (substr($normalizedFrom, 0, 4) === 'dev-' || substr($normalizedTo, 0, 4) === 'dev-') {
return true;
}
$sorted = Semver::sort(array($normalizedTo, $normalizedFrom));
return $sorted[0] === $normalizedFrom;