aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/search
diff options
context:
space:
mode:
authorNils Adermann <naderman@naderman.de>2007-01-13 22:32:03 +0000
committerNils Adermann <naderman@naderman.de>2007-01-13 22:32:03 +0000
commite6421f9274d3932539974790db1fcf81027a4db5 (patch)
treecf333c81622a49349ae1c089fc68dc5ade37204e /phpBB/includes/search
parent9372acd0170cf255dd0a1551479e6d75c7af7008 (diff)
downloadforums-e6421f9274d3932539974790db1fcf81027a4db5.tar
forums-e6421f9274d3932539974790db1fcf81027a4db5.tar.gz
forums-e6421f9274d3932539974790db1fcf81027a4db5.tar.bz2
forums-e6421f9274d3932539974790db1fcf81027a4db5.tar.xz
forums-e6421f9274d3932539974790db1fcf81027a4db5.zip
- solved a problem with magic urls inside brackets, and with bbcodes being treated as IPv6 addresses
- turn NOT IN () and IN () into 1=1 and 1=0 so the database will understand it, instead of throwing an error in sql_in_set [Bug #7118] - some tiny fixes to fulltext_native git-svn-id: file:///svn/phpbb/trunk@6886 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/search')
-rwxr-xr-xphpBB/includes/search/fulltext_native.php19
1 files changed, 11 insertions, 8 deletions
diff --git a/phpBB/includes/search/fulltext_native.php b/phpBB/includes/search/fulltext_native.php
index cbdef03b88..652495e734 100755
--- a/phpBB/includes/search/fulltext_native.php
+++ b/phpBB/includes/search/fulltext_native.php
@@ -80,7 +80,7 @@ class fulltext_native extends search_backend
*/
function split_keywords($keywords, $terms)
{
- global $db, $config, $user;
+ global $db, $user;
$keywords = trim($this->cleanup($keywords, '+-|()*'));
@@ -273,16 +273,19 @@ class fulltext_native extends search_backend
// if this is an array of words then retrieve an id for each
if (is_array($word))
{
+ $non_common_words = array();
$id_words = array();
foreach ($word as $i => $word_part)
{
if (strpos($word_part, '*') !== false)
{
$id_words[] = '\'' . $db->sql_escape(str_replace('*', '%', $word_part)) . '\'';
+ $non_common_words[] = $word_part;
}
- if (isset($words[$word_part]))
+ else if (isset($words[$word_part]))
{
$id_words[] = $words[$word_part];
+ $non_common_words[] = $word_part;
}
}
if (sizeof($id_words))
@@ -299,10 +302,11 @@ class fulltext_native extends search_backend
}
}
// throw an error if we shall not ignore unexistant words
- else if (!$ignore_no_id)
+ else if (!$ignore_no_id && sizeof($non_common_words))
{
- trigger_error(sprintf($user->lang['WORDS_IN_NO_POST'], implode(', ', $word)));
+ trigger_error(sprintf($user->lang['WORDS_IN_NO_POST'], implode(', ', $non_common_words)));
}
+ unset($non_common_words);
}
// else we only need one id
else if (($wildcard = strpos($word, '*') !== false) || isset($words[$word]))
@@ -930,8 +934,7 @@ class fulltext_native extends search_backend
*/
function split_message($text)
{
- global $phpbb_root_path, $phpEx;
- global $config, $user;
+ global $phpbb_root_path, $phpEx, $user;
$match = $words = array();
@@ -943,8 +946,8 @@ class fulltext_native extends search_backend
// BBcode
$match[] = '#\[\/?[a-z0-9\*\+\-]+(?:=.*?)?(?::[a-z])?(\:?[0-9a-z]{5,})\]#';
- $min = $config['fulltext_native_min_chars'];
- $max = $config['fulltext_native_max_chars'];
+ $min = $this->word_length['min'];
+ $max = $this->word_length['max'];
$isset_min = $min - 1;