Explorar o código

! Some of the values used on sm.org in the past have not been entirely legal but due to the complexities of getting that sorted out, it's better that we fix it softly here as well just in case.

Signed-off-by: Peter Spicer <[email protected]>
Peter Spicer %!s(int64=10) %!d(string=hai) anos
pai
achega
0e5585057b
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      Sources/Subs-Package.php

+ 1 - 1
Sources/Subs-Package.php

@@ -1554,7 +1554,7 @@ function compareVersions($version1, $version2)
 
 		// Build an array of parts.
 		$versions[$id] = array(
-			'major' => (int) $parts[1],
+			'major' => !empty($parts[1]) ? (int) $parts[1] : 0,
 			'minor' => !empty($parts[2]) ? (int) $parts[2] : 0,
 			'patch' => !empty($parts[3]) ? (int) $parts[3] : 0,
 			'type' => empty($parts[4]) ? 'stable' : $parts[4],