From: <nk...@us...> - 2011-03-18 21:50:16
|
Revision: 33535 http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=33535&view=rev Author: nkoth Date: 2011-03-18 21:50:10 +0000 (Fri, 18 Mar 2011) Log Message: ----------- [bp/r33534][FIX] greaterequal and other comparisons doing only string comparison resulting in 11 being smaller than 9 Modified Paths: -------------- branches/proposals/6.x/lib/trackers/trackerlib.php Modified: branches/proposals/6.x/lib/trackers/trackerlib.php =================================================================== --- branches/proposals/6.x/lib/trackers/trackerlib.php 2011-03-18 21:45:45 UTC (rev 33534) +++ branches/proposals/6.x/lib/trackers/trackerlib.php 2011-03-18 21:50:10 UTC (rev 33535) @@ -867,9 +867,13 @@ } elseif ($ev) { if (is_array($ev)) { $keys = array_keys($ev); - if (in_array((string)$keys[0], array('<', '>', '<=', '>='))) { - $mid .= " AND ttif$i.`value`".$keys[0].'?'; + if (in_array((string)$keys[0], array('<', '>'))) { + $mid .= " AND ttif$i.`value`".$keys[0]."? + 0"; $bindvars[] = $ev[$keys[0]]; + } elseif (in_array((string)$keys[0], array('<=', '>='))) { + $mid .= " AND (ttif$i.`value`".$keys[0]."? + 0 OR ttif$i.`value` = ?)"; + $bindvars[] = $ev[$keys[0]]; + $bindvars[] = $ev[$keys[0]]; } elseif ($keys[0] == 'not') { $mid .= " AND ttif$i.`value` not in (".implode(',', array_fill(0,count($ev),'?')).")"; $bindvars = array_merge($bindvars, array_values($ev)); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |