- Throw error on incorrect search queries [Bug #5648]

git-svn-id: file:///svn/phpbb/trunk@6675 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Nils Adermann 2006-11-27 20:31:06 +00:00
parent 1f118ba2ae
commit 49e8de0ca2

View file

@ -231,8 +231,8 @@ if ($keywords || $author || $author_id || $search_id || $submit)
// let the search module split up the keywords // let the search module split up the keywords
if ($keywords) if ($keywords)
{ {
$search->split_keywords($keywords, $search_terms); $correct_query = $search->split_keywords($keywords, $search_terms);
if (empty($search->search_query) && !sizeof($author_id_ary) && !$search_id) if (!$correct_query || (empty($search->search_query) && !sizeof($author_id_ary) && !$search_id))
{ {
$ignored = (sizeof($search->common_words)) ? sprintf($user->lang['IGNORED_TERMS_EXPLAIN'], htmlspecialchars(implode(' ', $search->common_words), ENT_COMPAT, 'UTF-8')) . '<br />' : ''; $ignored = (sizeof($search->common_words)) ? sprintf($user->lang['IGNORED_TERMS_EXPLAIN'], htmlspecialchars(implode(' ', $search->common_words), ENT_COMPAT, 'UTF-8')) . '<br />' : '';
trigger_error($ignored . sprintf($user->lang['NO_KEYWORDS'], $search->word_length['min'], $search->word_length['max'])); trigger_error($ignored . sprintf($user->lang['NO_KEYWORDS'], $search->word_length['min'], $search->word_length['max']));