Changeset 28996


Ignore:
Timestamp:
Jul 8, 2014, 12:38:54 AM (10 years ago)
Author:
rvelices
Message:

bug 3056 quick search - allow negative values in numeric scope searches

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/functions_search.inc.php

    r28992 r28996  
    337337    foreach ($range as $i =>&$val)
    338338    {
    339       if (preg_match('#^([0-9.]+)/([0-9.]+)$#i', $val, $matches))
     339      if (preg_match('#^(-?[0-9.]+)/([0-9.]+)$#i', $val, $matches))
    340340      {
    341341        $val = floatval($matches[1]/$matches[2]);
    342342      }
    343       elseif (preg_match('/^([0-9.]+)([km])?/i', $val, $matches))
     343      elseif (preg_match('/^(-?[0-9.]+)([km])?/i', $val, $matches))
    344344      {
    345345        $val = floatval($matches[1]);
Note: See TracChangeset for help on using the changeset viewer.