diff options
author | rxu <rxu@mail.ru> | 2014-08-16 02:07:12 +0800 |
---|---|---|
committer | rxu <rxu@mail.ru> | 2014-08-17 00:35:12 +0800 |
commit | 354d08dfff7a8b18cb4a0a1d59e4c74f527c1971 (patch) | |
tree | c939ad9a90896e7bf40396452f2ff58821152697 /phpBB/search.php | |
parent | 1dc2d0e759a622b04c94b089ec980857595fa7bf (diff) | |
download | forums-354d08dfff7a8b18cb4a0a1d59e4c74f527c1971.tar forums-354d08dfff7a8b18cb4a0a1d59e4c74f527c1971.tar.gz forums-354d08dfff7a8b18cb4a0a1d59e4c74f527c1971.tar.bz2 forums-354d08dfff7a8b18cb4a0a1d59e4c74f527c1971.tar.xz forums-354d08dfff7a8b18cb4a0a1d59e4c74f527c1971.zip |
[ticket/12986] Fix detection of common words in search
$search->get_common_words() call goes before the split_keywords() call,
but $search->common_words array is being generated
within the function $search->split_keywords(). Thus, get_common_words()
returned an empty array instead of common words array.
PHPBB3-12986
Diffstat (limited to 'phpBB/search.php')
-rw-r--r-- | phpBB/search.php | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/phpBB/search.php b/phpBB/search.php index 071db30f3d..67f6f4dbb5 100644 --- a/phpBB/search.php +++ b/phpBB/search.php @@ -281,12 +281,11 @@ if ($keywords || $author || $author_id || $search_id || $submit) trigger_error($error); } - $common_words = $search->get_common_words(); - // let the search module split up the keywords if ($keywords) { $correct_query = $search->split_keywords($keywords, $search_terms); + $common_words = $search->get_common_words(); if (!$correct_query || (!$search->get_search_query() && !sizeof($author_id_ary) && !$search_id)) { $ignored = (sizeof($common_words)) ? sprintf($user->lang['IGNORED_TERMS_EXPLAIN'], implode(' ', $common_words)) . '<br />' : ''; @@ -599,7 +598,7 @@ if ($keywords || $author || $author_id || $search_id || $submit) 'SEARCH_MATCHES' => $l_search_matches, 'SEARCH_WORDS' => $keywords, 'SEARCHED_QUERY' => $search->get_search_query(), - 'IGNORED_WORDS' => (sizeof($common_words)) ? implode(' ', $common_words) : '', + 'IGNORED_WORDS' => (!empty($common_words)) ? implode(' ', $common_words) : '', 'PHRASE_SEARCH_DISABLED' => $phrase_search_disabled, |