Skip to content

Commit

Permalink
bug 3056: quick search - fixes
Browse files Browse the repository at this point in the history
git-svn-id: http://piwigo.org/svn/trunk@28165 68402e56-0260-453c-a942-63ccdbb3a9ee
  • Loading branch information
rvelices committed Apr 13, 2014
1 parent e6a38c4 commit 76d4ccb
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions include/functions_search.inc.php
Expand Up @@ -831,12 +831,13 @@ function qsearch_get_text_token_search_sql($token, $fields)
$use_ft = mb_strlen($variant)>3;
if ($token->modifier & QST_WILDCARD_BEGIN)
$use_ft = false;
if (($token->modifier & QST_QUOTED|QST_WILDCARD_END) == QST_QUOTED|QST_WILDCARD_END)
if ($token->modifier & (QST_QUOTED|QST_WILDCARD_END) == (QST_QUOTED|QST_WILDCARD_END))
$use_ft = false;

if ($use_ft)
{
$max = max( array_map( 'mb_strlen',
preg_split('/['.preg_quote('!"#$%&()*+,./:;<=>?@[\]^`{|}~','/').']+/', $variant0, PREG_SPLIT_NO_EMPTY)
preg_split('/['.preg_quote('!"#$%&()*+,./:;<=>?@[\]^`{|}~','/').']+/', $variant, PREG_SPLIT_NO_EMPTY)
) );
if ($max<4)
$use_ft = false;
Expand Down

0 comments on commit 76d4ccb

Please sign in to comment.