1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-31 14:00:31 +02:00

[ticket/11051] add get_word_len() in sphinx search

get_word_len() for sphinx search backend returns false always and
triggers proper error.

PHPBB3-11051
This commit is contained in:
Dhruv
2012-10-04 01:51:57 +05:30
parent a2e1989b01
commit 52b25aaf20
2 changed files with 18 additions and 1 deletions

View File

@@ -296,7 +296,14 @@ if ($keywords || $author || $author_id || $search_id || $submit)
$ignored = (sizeof($search->get_common_words())) ? sprintf($user->lang['IGNORED_TERMS_EXPLAIN'], implode(' ', $search->get_common_words())) . '<br />' : '';
// Function cannot be directly used as associative array for php < 5.4
$word_length = $search->get_word_length();
trigger_error($ignored . $user->lang('NO_KEYWORDS', $user->lang('CHARACTERS', (int) $word_length['min']), $user->lang('CHARACTERS', (int) $word_length['max'])));
if ($word_length)
{
trigger_error($ignored . $user->lang('NO_KEYWORDS', $user->lang('CHARACTERS', (int) $word_length['min']), $user->lang('CHARACTERS', (int) $word_length['max'])));
}
else
{
trigger_error($ignored);
}
}
}