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
This commit is contained in:
rvelices
2014-07-07 22:38:54 +00:00
parent a7e57cf852
commit 03c16caf50
+2 -2
View File
@@ -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]))