diff options
author | Stilez <stilez@no-spam.org> | 2013-03-06 19:05:00 +0000 |
---|---|---|
committer | Stilez <stilez@no-spam.org> | 2013-03-06 19:05:00 +0000 |
commit | f8c8d65cc176fe779f5483223e5e8387303e1a8f (patch) | |
tree | 90e19d0dec3529ae95681631630555d3a091d1b8 | |
parent | 1a8c81e7295944ebf4e2ceefa8ddb6e651d46b77 (diff) | |
download | pfsense-f8c8d65cc176fe779f5483223e5e8387303e1a8f.zip pfsense-f8c8d65cc176fe779f5483223e5e8387303e1a8f.tar.gz |
Fix issue in version_compare that can cause versions to be wrongly marked incompatible
-rw-r--r-- | etc/inc/pfsense-utils.inc | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc index f619fc8..b759987 100644 --- a/etc/inc/pfsense-utils.inc +++ b/etc/inc/pfsense-utils.inc @@ -1926,7 +1926,8 @@ function version_get_string_value($a) { 5 => "C", 6 => "D", 7 => "RC", - 8 => "RELEASE" + 8 => "RELEASE", + 9 => "*" // Matches all release levels ); $major = 0; $minor = 0; @@ -1942,7 +1943,12 @@ function version_get_string_value($a) { return "{$major}.{$minor}"; } function version_compare_string($a, $b) { - return version_compare_numeric(version_get_string_value($a), version_get_string_value($b)); + // Only compare string parts if both versions give a specific release + // (If either version lacks a string part, assume intended to match all release levels) + if (isset($a) && isset($b)) + return version_compare_numeric(version_get_string_value($a), version_get_string_value($b)); + else + return 0; } function version_compare_numeric($a, $b) { $a_arr = explode('.', rtrim($a, '.0')); |