aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/search.php
diff options
context:
space:
mode:
authorNathan Guse <nathaniel.guse@gmail.com>2012-10-12 17:09:12 -0500
committerNathan Guse <nathaniel.guse@gmail.com>2012-10-12 17:09:12 -0500
commit94a3dc5ff7292c8271dfcff9408aa89d401b72ac (patch)
tree6c7bd95bc177a40ee8f7e81fc3f2333c53363a8d /phpBB/search.php
parent3d79ce28031b4c85ee34bd4d43f0c64b18b1a80b (diff)
parentf1a692a5f45d993fe2578f13d365ca10543696f8 (diff)
downloadforums-94a3dc5ff7292c8271dfcff9408aa89d401b72ac.tar
forums-94a3dc5ff7292c8271dfcff9408aa89d401b72ac.tar.gz
forums-94a3dc5ff7292c8271dfcff9408aa89d401b72ac.tar.bz2
forums-94a3dc5ff7292c8271dfcff9408aa89d401b72ac.tar.xz
forums-94a3dc5ff7292c8271dfcff9408aa89d401b72ac.zip
Merge branch 'develop' of git://github.com/phpbb/phpbb3 into ticket/11103
Diffstat (limited to 'phpBB/search.php')
-rw-r--r--phpBB/search.php22
1 files changed, 16 insertions, 6 deletions
diff --git a/phpBB/search.php b/phpBB/search.php
index 190da5247f..7eda3c4d1d 100644
--- a/phpBB/search.php
+++ b/phpBB/search.php
@@ -287,14 +287,24 @@ 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);
- if (!$correct_query || (empty($search->search_query) && !sizeof($author_id_ary) && !$search_id))
+ if (!$correct_query || (!$search->get_search_query() && !sizeof($author_id_ary) && !$search_id))
{
- $ignored = (sizeof($search->common_words)) ? sprintf($user->lang['IGNORED_TERMS_EXPLAIN'], implode(' ', $search->common_words)) . '<br />' : '';
- trigger_error($ignored . $user->lang('NO_KEYWORDS', $user->lang('CHARACTERS', (int) $search->word_length['min']), $user->lang('CHARACTERS', (int) $search->word_length['max'])));
+ $ignored = (sizeof($common_words)) ? sprintf($user->lang['IGNORED_TERMS_EXPLAIN'], implode(' ', $common_words)) . '<br />' : '';
+ $word_length = $search->get_word_length();
+ 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);
+ }
}
}
@@ -526,7 +536,7 @@ if ($keywords || $author || $author_id || $search_id || $submit)
sort($m_approve_fid_ary);
sort($author_id_ary);
- if (!empty($search->search_query))
+ if ($search->get_search_query())
{
$total_match_count = $search->keyword_search($show_results, $search_fields, $search_terms, $sort_by_sql, $sort_key, $sort_dir, $sort_days, $ex_fid_ary, $m_approve_fid_ary, $topic_id, $author_id_ary, $sql_author_match, $id_ary, $start, $per_page);
}
@@ -609,8 +619,8 @@ if ($keywords || $author || $author_id || $search_id || $submit)
'SEARCH_TITLE' => $l_search_title,
'SEARCH_MATCHES' => $l_search_matches,
'SEARCH_WORDS' => $keywords,
- 'SEARCHED_QUERY' => $search->search_query,
- 'IGNORED_WORDS' => (sizeof($search->common_words)) ? implode(' ', $search->common_words) : '',
+ 'SEARCHED_QUERY' => $search->get_search_query(),
+ 'IGNORED_WORDS' => (sizeof($common_words)) ? implode(' ', $common_words) : '',
'PAGE_NUMBER' => phpbb_on_page($template, $user, $u_search, $total_match_count, $per_page, $start),
'PHRASE_SEARCH_DISABLED' => $phrase_search_disabled,