diff options
author | Phil Davis <phil.davis@inf.org> | 2015-08-09 17:15:20 +0545 |
---|---|---|
committer | Phil Davis <phil.davis@inf.org> | 2015-08-09 17:15:20 +0545 |
commit | 4fdcdbf33c1354d81001ad4d6a4f6a35e2db9d13 (patch) | |
tree | 5c424063a5887b844a739ffe565db18e2fd974be | |
parent | 5685a7410277b2a671f5d85bc76bfda525f70dfc (diff) | |
download | pfsense-4fdcdbf33c1354d81001ad4d6a4f6a35e2db9d13.zip pfsense-4fdcdbf33c1354d81001ad4d6a4f6a35e2db9d13.tar.gz |
Ignore case when comparing package versions
So that "versions" that probably are the same will be compared the same:
"Utility-1.0" and "utility-1.0"
"2.3.4_5 pkg v1.2" and "2.3.4_5 pkg V1.2" and "2.3.4_5 Pkg V1.2" and...
This will allow people to modify the case of the version text however they like without making the istalled packages list look like there is an upgrade (or downgrade).
-rw-r--r-- | etc/inc/pkg-utils.inc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/etc/inc/pkg-utils.inc b/etc/inc/pkg-utils.inc index ff66702..195de9f 100644 --- a/etc/inc/pkg-utils.inc +++ b/etc/inc/pkg-utils.inc @@ -237,9 +237,9 @@ function compare_pkg_versions($installed_pkg_ver, $available_pkg_ver) { $val2_as_int = filter_var($available_arr[$n], FILTER_VALIDATE_INT); if (($val1_as_int === false) || ($val2_as_int === false)) { // One of them does not look like a genuine integer so use string comparison. - if (strcmp($val, $available_arr[$n]) > 0) { + if (strcasecmp($val, $available_arr[$n]) > 0) { return 1; - } elseif (strcmp($val, $available_arr[$n]) < 0) { + } elseif (strcasecmp($val, $available_arr[$n]) < 0) { return -1; } } else { |