aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes
diff options
context:
space:
mode:
authorPaul S. Owen <psotfx@users.sourceforge.net>2002-01-28 18:47:31 +0000
committerPaul S. Owen <psotfx@users.sourceforge.net>2002-01-28 18:47:31 +0000
commitff582a4290129621faa010ff2f00b533add5654b (patch)
tree48b77118a4b9458c216d48380fcb3043a31417d9 /phpBB/includes
parente4cdf71b07c83ce55fe9735f4e2c968522e991d7 (diff)
downloadforums-ff582a4290129621faa010ff2f00b533add5654b.tar
forums-ff582a4290129621faa010ff2f00b533add5654b.tar.gz
forums-ff582a4290129621faa010ff2f00b533add5654b.tar.bz2
forums-ff582a4290129621faa010ff2f00b533add5654b.tar.xz
forums-ff582a4290129621faa010ff2f00b533add5654b.zip
Fix a couple of warning 'generators'
git-svn-id: file:///svn/phpbb/trunk@2004 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes')
-rw-r--r--phpBB/includes/search.php12
1 files changed, 8 insertions, 4 deletions
diff --git a/phpBB/includes/search.php b/phpBB/includes/search.php
index 1722ba75e4..81c3ef3a72 100644
--- a/phpBB/includes/search.php
+++ b/phpBB/includes/search.php
@@ -118,17 +118,19 @@ function add_search_words($post_id, $post_text, $post_title = "")
{
$title_match = ( $word_in == 'title' ) ? 1 : 0;
- if( count($search_matches) )
+ if( !empty($search_matches) )
{
- $word = array();
sort($search_matches);
+ $word = array();
+ $prev_word = "";
$word_text_sql = "";
+
for ($i = 0; $i < count($search_matches); $i++)
{
$search_matches[$i] = trim($search_matches[$i]);
- if( $search_matches[$i] != "" && $search_matches[$i] != $search_matches[$i-1] )
+ if( $search_matches[$i] != "" && $search_matches[$i] != $prev_word )
{
$word[] = $search_matches[$i];
@@ -139,6 +141,8 @@ function add_search_words($post_id, $post_text, $post_title = "")
$word_text_sql .= "'" . $search_matches[$i] . "'";
}
+
+ $prev_word = $search_matches[$i];
}
$sql = "SELECT word_id, word_text, word_common
@@ -175,7 +179,7 @@ function add_search_words($post_id, $post_text, $post_title = "")
}
}
- if( !$check_words[$word[$i]] )
+ if( empty($check_words[$word[$i]]) )
{
$match_word[] = "'" . $word[$i] . "'";
}