aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions_admin.php
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/includes/functions_admin.php')
-rw-r--r--phpBB/includes/functions_admin.php24
1 files changed, 22 insertions, 2 deletions
diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php
index 3929b43448..08f90fab83 100644
--- a/phpBB/includes/functions_admin.php
+++ b/phpBB/includes/functions_admin.php
@@ -509,7 +509,7 @@ function delete_topics($where_type, $where_ids, $auto_sync = true)
*/
function delete_posts($where_type, $where_ids, $auto_sync = true)
{
- global $db;
+ global $db, $config, $phpbb_root_path, $phpEx;
if (is_array($where_ids))
{
@@ -542,7 +542,7 @@ function delete_posts($where_type, $where_ids, $auto_sync = true)
$db->sql_transaction('begin');
- $table_ary = array(POSTS_TABLE, REPORTS_TABLE, SEARCH_MATCH_TABLE);
+ $table_ary = array(POSTS_TABLE, REPORTS_TABLE);
foreach ($table_ary as $table)
{
@@ -552,6 +552,26 @@ function delete_posts($where_type, $where_ids, $auto_sync = true)
}
unset($table_ary);
+ // Remove the message from the search index
+ $search_type = $config['search_type'];
+
+ if (!file_exists($phpbb_root_path . 'includes/search/' . $search_type . '.' . $phpEx))
+ {
+ trigger_error('NO_SUCH_SEARCH_MODULE');
+ }
+
+ require("{$phpbb_root_path}includes/search/$search_type.$phpEx");
+
+ $error = false;
+ $search = new $search_type($error);
+
+ if ($error)
+ {
+ trigger_error($error);
+ }
+
+ $search->index_remove($where_ids);
+
delete_attachments('post', $post_ids, false);
$db->sql_transaction('commit');