diff --git a/phpgwapi/inc/class.common.inc.php b/phpgwapi/inc/class.common.inc.php index eaa64504bc..3ffac60b6f 100644 --- a/phpgwapi/inc/class.common.inc.php +++ b/phpgwapi/inc/class.common.inc.php @@ -55,10 +55,10 @@ { ereg("([0-9]+)\.([0-9]+)\.([0-9]+)[a-zA-Z]*([0-9]*)",$str1,$regs); ereg("([0-9]+)\.([0-9]+)\.([0-9]+)[a-zA-Z]*([0-9]*)",$str2,$regs2); - //echo "$regs[0] - $regs2[0]"; + //echo "
$regs[0] - $regs2[0]"; for($i=1;$i<5;$i++) { - //echo "
$regs[$i] - $regs2[$i]"; + echo "
$i: $regs[$i] - $regs2[$i]"; if($regs2[$i] == $regs[$i]) { continue; @@ -81,27 +81,33 @@ @param $str1 @param $str2 */ - function cmp_version_long($str1,$str2) + function cmp_version_long($str1,$str2,$debug=False) { ereg("([0-9]+)\.([0-9]+)\.([0-9]+)[a-zA-Z]*([0-9]*)\.([0-9]*)",$str1,$regs); ereg("([0-9]+)\.([0-9]+)\.([0-9]+)[a-zA-Z]*([0-9]*)\.([0-9]*)",$str2,$regs2); - //echo "$regs[0] - $regs2[0]"; + if($debug) { echo "
$regs[0] - $regs2[0]"; } + for($i=1;$i<6;$i++) { - //echo "
$regs[$i] - $regs2[$i]"; + if($debug) { echo "
$i: $regs[$i] - $regs2[$i]"; } + if($regs2[$i] == $regs[$i]) { + if($debug) { echo ' are equal...'; } continue; } if($regs2[$i] > $regs[$i]) { + if($debug) { echo ', and a > b'; } return 1; } elseif($regs2[$i] < $regs[$i]) { + if($debug) { echo ', and a < b'; } return 0; } } + if($debug) { echo ' - all equal.'; } } // Convert an array into the format needed for the access column.