aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions_posting.php
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/includes/functions_posting.php')
-rw-r--r--phpBB/includes/functions_posting.php17
1 files changed, 7 insertions, 10 deletions
diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php
index 4ef5585b27..e195791445 100644
--- a/phpBB/includes/functions_posting.php
+++ b/phpBB/includes/functions_posting.php
@@ -389,7 +389,7 @@ class fulltext_search
// echo "Search parser time taken >> " . ($mtime[1] + $mtime[0] - $starttime);
// Run the cleanup infrequently, once per session cleanup
- if ($config['search_last_gc'] < time - $config['search_gc'])
+ if ($config['search_last_gc'] < time() - $config['search_gc'])
{
// $this->search_tidy();
}
@@ -447,18 +447,16 @@ class fulltext_search
if ($row = $db->sql_fetchrow($result))
{
$in_sql = '';
- while ( $row = $db->sql_fetchrow($result) )
+ do
{
- $in_sql .= ( ( $in_sql != '' ) ? ', ' : '' ) . $row['word_id'];
+ $in_sql .= ',' . $row['word_id'];
}
+ while ($row = $db->sql_fetchrow($result));
$db->sql_freeresult($result);
- if ($in_sql)
- {
- $sql = "DELETE FROM " . SEARCH_WORD_TABLE . "
- WHERE word_id IN ($in_sql)";
- $db->sql_query($sql);
- }
+ $sql = 'DELETE FROM ' . SEARCH_WORD_TABLE . '
+ WHERE word_id IN (' . substr($in_sql, 1) . ')';
+ $db->sql_query($sql);
}
}
}
@@ -513,7 +511,6 @@ function generate_smilies($mode)
}
}
while ($row = $db->sql_fetchrow($result));
-
$db->sql_freeresult($result);
if ($mode == 'inline' && $num_smilies >= 20)