diff options
author | rvelices <rv-github@modusoptimus.com> | 2014-07-07 22:38:54 +0000 |
---|---|---|
committer | rvelices <rv-github@modusoptimus.com> | 2014-07-07 22:38:54 +0000 |
commit | 03c16caf50c3d49ea59144425efca8c4cea8eb8f (patch) | |
tree | 91da2595387bb6455c139dd27b7ea424a70627d0 /include/functions_search.inc.php | |
parent | a7e57cf852cdea395c5f6e75fdd82e3941383acb (diff) |
bug 3056 quick search - allow negative values in numeric scope searches
git-svn-id: http://piwigo.org/svn/trunk@28996 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'include/functions_search.inc.php')
-rw-r--r-- | include/functions_search.inc.php | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/functions_search.inc.php b/include/functions_search.inc.php index da1ff73ea..a65c26ace 100644 --- a/include/functions_search.inc.php +++ b/include/functions_search.inc.php @@ -336,11 +336,11 @@ class QNumericRangeScope extends QSearchScope foreach ($range as $i =>&$val) { - if (preg_match('#^([0-9.]+)/([0-9.]+)$#i', $val, $matches)) + if (preg_match('#^(-?[0-9.]+)/([0-9.]+)$#i', $val, $matches)) { $val = floatval($matches[1]/$matches[2]); } - elseif (preg_match('/^([0-9.]+)([km])?/i', $val, $matches)) + elseif (preg_match('/^(-?[0-9.]+)([km])?/i', $val, $matches)) { $val = floatval($matches[1]); if (isset($matches[2])) |