Pārlūkot izejas kodu

! 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 10 gadi atpakaļ
vecāks
revīzija
0e5585057b
1 mainītis faili ar 1 papildinājumiem un 1 dzēšanām
  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],