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.php12
1 files changed, 7 insertions, 5 deletions
diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php
index 8ce0975dc8..688240360d 100644
--- a/phpBB/includes/functions_admin.php
+++ b/phpBB/includes/functions_admin.php
@@ -663,11 +663,13 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = FALSE,
}
}
- $sql = 'UPDATE ' . TOPICS_TABLE . '
- SET topic_reported = 1 - topic_reported
- WHERE topic_id IN (' . implode(', ', $topic_ids) . ')';
- $db->sql_query($sql);
- unset($topic_ids);
+ if (count($topic_ids))
+ {
+ $sql = 'UPDATE ' . TOPICS_TABLE . '
+ SET topic_reported = 1 - topic_reported
+ WHERE topic_id IN (' . implode(', ', $topic_ids) . ')';
+ $db->sql_query($sql);
+ }
}
$db->sql_freeresult($result);