aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions_admin.php
diff options
context:
space:
mode:
authorAndreas Fischer <bantu@phpbb.com>2010-02-23 18:52:06 +0000
committerAndreas Fischer <bantu@phpbb.com>2010-02-23 18:52:06 +0000
commit2ec1d9238878fe3838f296e77cd05493e19e38ab (patch)
tree2d8aaf4f55b77ff14c55312e05e9754b83bec1ee /phpBB/includes/functions_admin.php
parent2c3c97b8eeb5ba55d9200efa030b21b52ceff5ee (diff)
downloadforums-2ec1d9238878fe3838f296e77cd05493e19e38ab.tar
forums-2ec1d9238878fe3838f296e77cd05493e19e38ab.tar.gz
forums-2ec1d9238878fe3838f296e77cd05493e19e38ab.tar.bz2
forums-2ec1d9238878fe3838f296e77cd05493e19e38ab.tar.xz
forums-2ec1d9238878fe3838f296e77cd05493e19e38ab.zip
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
Diffstat (limited to 'phpBB/includes/functions_admin.php')
-rw-r--r--phpBB/includes/functions_admin.php13
1 files changed, 7 insertions, 6 deletions
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)