Skip to content

Commit

Permalink
git-svn-id: http://piwigo.org/svn/trunk@29804 68402e56-0260-453c-a942…
Browse files Browse the repository at this point in the history
…-63ccdbb3a9ee
  • Loading branch information
rvelices committed Sep 26, 2014
1 parent ba16019 commit b3a6125
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
14 changes: 9 additions & 5 deletions include/functions_search.inc.php
Expand Up @@ -384,9 +384,9 @@ function parse($token)
function get_sql($field, $token)
{
$clauses = array();
if ($token->scope_data['range'][0]!=='')
if ($token->scope_data['range'][0]!='')
$clauses[] = $field.' >'.($token->scope_data['strict'][0]?'':'=').$token->scope_data['range'][0].' ';
if ($token->scope_data['range'][1]!=='')
if ($token->scope_data['range'][1]!='')
$clauses[] = $field.' <'.($token->scope_data['strict'][1]?'':'=').$token->scope_data['range'][1].' ';

if (empty($clauses))
Expand Down Expand Up @@ -458,9 +458,9 @@ function parse($token)
function get_sql($field, $token)
{
$clauses = array();
if ($token->scope_data[0]!=='')
if ($token->scope_data[0]!='')
$clauses[] = $field.' >= \'' . $token->scope_data[0].'\'';
if ($token->scope_data[1]!=='')
if ($token->scope_data[1]!='')
$clauses[] = $field.' <= \'' . $token->scope_data[1].'\'';

if (empty($clauses))
Expand Down Expand Up @@ -1081,7 +1081,7 @@ function qsearch_eval(QMultiToken $expr, QResults $qsr, &$qualifies, &$ignored_t
{
$crt_ids = $qsr->iids[$crt->idx] = array_unique( array_merge($qsr->images_iids[$crt->idx], $qsr->tag_iids[$crt->idx]) );
$crt_qualifies = count($crt_ids)>0 || count($qsr->tag_ids[$crt->idx])>0;
$crt_ignored_terms = $crt_qualifies ? array() : array($crt->term);
$crt_ignored_terms = $crt_qualifies ? array() : array((string)$crt);
}
else
$crt_ids = qsearch_eval($crt, $qsr, $crt_qualifies, $crt_ignored_terms);
Expand Down Expand Up @@ -1172,6 +1172,8 @@ function get_quick_search_results_no_cache($q, $options)
'qs' => array('q'=>$q),
);

$q = trigger_change('qsearch_pre', $q);

$scopes = array();
$scopes[] = new QSearchScope('tag', array('tags'));
$scopes[] = new QSearchScope('photo', array('photos'));
Expand Down Expand Up @@ -1247,6 +1249,8 @@ function get_quick_search_results_no_cache($q, $options)
$debug[] = 'before perms '.count($ids);

$search_results['qs']['matching_tags'] = $qsr->all_tags;
$search_results = trigger_change('qsearch_results', $search_results, $expression, $qsr);

global $template;

if (empty($ids))
Expand Down
2 changes: 1 addition & 1 deletion index.php
Expand Up @@ -245,7 +245,7 @@
}
elseif (!empty($page['qsearch_details']['unmatched_terms']))
{
$template->assign( 'no_search_results', $page['qsearch_details']['unmatched_terms']);
$template->assign( 'no_search_results', array_map($page['qsearch_details']['unmatched_terms'], 'htmlspecialchars'));
}
}

Expand Down

0 comments on commit b3a6125

Please sign in to comment.