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);