Actions
Bug #1273
closedbugs if pfs_version_compare
Start date:
02/10/2011
Due date:
% Done:
100%
Estimated time:
0.20 h
Plus Target Version:
Release Notes:
Affected Version:
2.0
Affected Architecture:
All
Description
There are two bugs in functions which compare pfSense versions.
It doesn't work when update version is older than the installed one...
Here is a patch against /etc/inc/pfsense-utils.inc (also attached) :
--- pfsense-utils.inc.orig 2011-02-10 14:19:31.669065996 +0100 +++ pfsense-utils.inc 2011-02-10 14:19:05.809065993 +0100 @@ -1674,9 +1674,9 @@ if ((!$a_time) || (!$b_time)) { return FALSE; } else { - if ($a < $b) + if ($a_time < $b_time) return -1; - elseif ($a == $b) + elseif ($a_time == $b_time) return 0; else return 1; @@ -1735,7 +1735,7 @@ } function pfs_version_compare($cur_time, $cur_text, $remote) { // First try date compare - $v = version_compare_dates($cur_time, $b); + $v = version_compare_dates($cur_time, $remote); if ($v === FALSE) { // If that fails, try to compare by string // Before anything else, simply test if the strings are equal
Thanks.
Files
Actions