From 03c16caf50c3d49ea59144425efca8c4cea8eb8f Mon Sep 17 00:00:00 2001 From: rvelices Date: Mon, 7 Jul 2014 22:38:54 +0000 Subject: [PATCH] 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 --- include/functions_search.inc.php | 4 ++-- 1 file 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]))