Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ticket/12986] Fix detection of common words in search #2881

Merged
merged 1 commit into from Aug 16, 2014

Conversation

@rxu
Copy link
Contributor

rxu commented Aug 15, 2014

$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.

@@ -599,7 +598,7 @@
'SEARCH_MATCHES' => $l_search_matches,
'SEARCH_WORDS' => $keywords,
'SEARCHED_QUERY' => $search->get_search_query(),
'IGNORED_WORDS' => (sizeof($common_words)) ? implode(' ', $common_words) : '',
'IGNORED_WORDS' => (isset($common_words) && sizeof($common_words)) ? implode(' ', $common_words) : '',

This comment has been minimized.

Copy link
@marc1706

marc1706 Aug 16, 2014

Member

Should be using !empty() instead of isset() and sizeof()

$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
@rxu

This comment has been minimized.

Copy link
Contributor Author

rxu commented Aug 16, 2014

Updated #2881.

bantu added a commit that referenced this pull request Aug 16, 2014
[ticket/12986] Fix detection of common words in search

* rxu/ticket/12986:
  [ticket/12986] Fix detection of common words in search
@bantu bantu merged commit 354d08d into phpbb:develop-ascraeus Aug 16, 2014
1 check passed
1 check passed
continuous-integration/travis-ci The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.