fixes #563 quick search filter, wrong limits on upper range limit

This commit is contained in:
modus75
2016-12-09 21:59:34 +01:00
parent 0a90a68915
commit 25e2954490
2 changed files with 6 additions and 2 deletions

View File

@@ -359,6 +359,7 @@ class QNumericRangeScope extends QSearchScope
{
$str = $token->term;
$strict = array(0,0);
$range_requested = true;
if ( ($pos = strpos($str, '..')) !== false)
$range = array( substr($str,0,$pos), substr($str, $pos+2));
elseif ('>' == @$str[0])// ratio:>1
@@ -376,7 +377,10 @@ class QNumericRangeScope extends QSearchScope
elseif( ($token->modifier & QST_WILDCARD_END) )
$range = array($str, '');
else
{
$range = array($str, $str);
$range_requested = false;
}
foreach ($range as $i =>&$val)
{
@@ -395,7 +399,7 @@ class QNumericRangeScope extends QSearchScope
else
$mult = 1000000;
$val *= $mult;
if ($i && !$strict[1])
if ($i && !$range_requested)
{// round up the upper limit if possible - e.g 6k goes up to 6999, but 6.12k goes only up to 6129
if ( ($dot_pos = strpos($matches[1], '.')) !== false )
{

View File

@@ -124,7 +124,7 @@ $template->set_filename('index', 'index.tpl');
// +-----------------------------------------------------------------------+
// | index page (categories, thumbnails, search, calendar, random, etc.) |
// +-----------------------------------------------------------------------+
if ( empty($page['is_external']) or !$page['is_external'] )
if ( empty($page['is_external']) )
{
//----------------------------------------------------- template initialization
$page['body_id'] = 'theCategoryPage';