Преглед на файлове

! 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 години
родител
ревизия
0e5585057b
променени са 1 файла, в които са добавени 1 реда и са изтрити 1 реда
  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],