From 2ec1d9238878fe3838f296e77cd05493e19e38ab Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Tue, 23 Feb 2010 18:52:06 +0000 Subject: [PATCH] Fix Bug #57375 - Do not delete unrelated attachments when deleting empty forums. git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@10526 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/docs/CHANGELOG.html | 1 + phpBB/includes/functions_admin.php | 13 +++++++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index 7a67093c5e..136f53864f 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -176,6 +176,7 @@
  • [Fix] Global announcements could not be accessed on a board using Firebird as the database server. (Bug #57525)
  • [Fix] BBCode parser now uses the user object for all settings rather than taking some from the template object (Bug #57365)
  • [Fix] Ensure a database connection is available before logging general errors. (Bug #57975)
  • +
  • [Fix] Do not delete unrelated attachments when deleting empty forums. (Bug #57375)
  • [Change] Move redirect into a hidden field to avoid issues with mod_security. (Bug #54145)
  • [Change] Log activation through inactive users ACP. (Bug #30145)
  • [Change] Send time of last item instead of current time in ATOM Feeds. (Bug #53305)
  • diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php index 955ef4df58..93244be55c 100644 --- a/phpBB/includes/functions_admin.php +++ b/phpBB/includes/functions_admin.php @@ -913,7 +913,13 @@ function delete_attachments($mode, $ids, $resync = true) { global $db, $config; - if (is_array($ids) && sizeof($ids)) + // 0 is as bad as an empty array + if (empty($ids)) + { + return false; + } + + if (is_array($ids)) { $ids = array_unique($ids); $ids = array_map('intval', $ids); @@ -923,11 +929,6 @@ function delete_attachments($mode, $ids, $resync = true) $ids = array((int) $ids); } - if (!sizeof($ids)) - { - return false; - } - $sql_where = ''; switch ($mode)