mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-07-06 09:52:29 +02:00
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:
@@ -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]))
|
||||
|
||||
Reference in New Issue
Block a user