diff options
Diffstat (limited to 'phpBB/includes/functions_admin.php')
| -rw-r--r-- | phpBB/includes/functions_admin.php | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php index 35f1dc2cc0..913962f566 100644 --- a/phpBB/includes/functions_admin.php +++ b/phpBB/includes/functions_admin.php @@ -779,12 +779,20 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = FALSE, } else { + if (!sizeof($where_ids)) + { + return; + } $where_sql = 'WHERE ' . $mode{0} . ".$where_type IN (" . implode(', ', $where_ids) . ')'; $where_sql_and = $where_sql . "\n\tAND"; } } else { + if (!sizeof($where_ids)) + { + return; + } $where_sql = 'WHERE ' . $mode{0} . ".$where_type IN (" . implode(', ', $where_ids) . ')'; $where_sql_and = $where_sql . "\n\tAND"; } @@ -807,7 +815,7 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = FALSE, FROM ' .TOPICS_TABLE . ' t1, ' . TOPICS_TABLE . " t2 WHERE t1.topic_moved_id = t2.topic_id AND t1.forum_id = t2.forum_id"; - $result = $db->sql_query($result); + $result = $db->sql_query($sql); if ($row = $db->sql_fetchrow($result)) { |
