ソースを参照

! 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],