aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/search/fulltext_mysql.php
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2009-04-11 11:09:45 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2009-04-11 11:09:45 +0000
commit4d9b106db2ccc6e15b4afd3fc2e69cf37fae81cf (patch)
treec2c98e5c550b9a9e3b19a0e9d6332437b453da26 /phpBB/includes/search/fulltext_mysql.php
parentcda9e5e9ec0dfe9c3e0a04809ffc5d0099020046 (diff)
downloadforums-4d9b106db2ccc6e15b4afd3fc2e69cf37fae81cf.tar
forums-4d9b106db2ccc6e15b4afd3fc2e69cf37fae81cf.tar.gz
forums-4d9b106db2ccc6e15b4afd3fc2e69cf37fae81cf.tar.bz2
forums-4d9b106db2ccc6e15b4afd3fc2e69cf37fae81cf.tar.xz
forums-4d9b106db2ccc6e15b4afd3fc2e69cf37fae81cf.zip
New search option: Maximum number of words allowed to search for.
(the more words the more database load) git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9438 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/search/fulltext_mysql.php')
-rw-r--r--phpBB/includes/search/fulltext_mysql.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/phpBB/includes/search/fulltext_mysql.php b/phpBB/includes/search/fulltext_mysql.php
index 2a67b58246..e1e7951367 100644
--- a/phpBB/includes/search/fulltext_mysql.php
+++ b/phpBB/includes/search/fulltext_mysql.php
@@ -118,7 +118,7 @@ class fulltext_mysql extends search_backend
*/
function split_keywords(&$keywords, $terms)
{
- global $config;
+ global $config, $user;
if ($terms == 'all')
{
@@ -167,6 +167,12 @@ class fulltext_mysql extends search_backend
$this->split_words = $matches[1];
}
+ // We limit the number of allowed keywords to minimize load on the database
+ if ($config['max_num_search_keywords'] && sizeof($this->split_words) > $config['max_num_search_keywords'])
+ {
+ trigger_error($user->lang('MAX_NUM_SEARCH_KEYWORDS_REFINE', $config['max_num_search_keywords'], sizeof($this->split_words)));
+ }
+
// to allow phrase search, we need to concatenate quoted words
$tmp_split_words = array();
$phrase = '';