Explorar o código

Consider 0 as part of a version

Rob Bast %!s(int64=9) %!d(string=hai) anos
pai
achega
a0ca1d4d96
Modificáronse 1 ficheiros con 5 adicións e 1 borrados
  1. 5 1
      src/Composer/Package/Version/VersionParser.php

+ 5 - 1
src/Composer/Package/Version/VersionParser.php

@@ -416,7 +416,11 @@ class VersionParser
             $lowVersion = $this->normalize($matches['from']);
             $lowerBound = new VersionConstraint('>=', $lowVersion . $lowStabilitySuffix);
 
-            if ((!empty($matches[11]) && !empty($matches[12])) || !empty($matches[14]) || !empty($matches[16])) {
+            $empty = function ($x) {
+                return ($x === 0 || $x === "0") ? false : empty($x);
+            };
+
+            if ((!$empty($matches[11]) && !$empty($matches[12])) || !empty($matches[14]) || !empty($matches[16])) {
                 $highVersion = $this->normalize($matches['to']);
                 $upperBound = new VersionConstraint('<=', $highVersion);
             } else {