diff options
author | Meik Sievertsen <acydburn@phpbb.com> | 2007-09-26 16:53:40 +0000 |
---|---|---|
committer | Meik Sievertsen <acydburn@phpbb.com> | 2007-09-26 16:53:40 +0000 |
commit | b2afdc0704e2c827e0174a113ea105a551b15039 (patch) | |
tree | 289484d37171c07a1877d38515e0bb87c96b6995 /phpBB/includes/ucp | |
parent | cb85c2c57cd7d6bfd93950f993125d4a6771e65e (diff) | |
download | forums-b2afdc0704e2c827e0174a113ea105a551b15039.tar forums-b2afdc0704e2c827e0174a113ea105a551b15039.tar.gz forums-b2afdc0704e2c827e0174a113ea105a551b15039.tar.bz2 forums-b2afdc0704e2c827e0174a113ea105a551b15039.tar.xz forums-b2afdc0704e2c827e0174a113ea105a551b15039.zip |
#i53
git-svn-id: file:///svn/phpbb/trunk@8113 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/ucp')
-rw-r--r-- | phpBB/includes/ucp/ucp_attachments.php | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/phpBB/includes/ucp/ucp_attachments.php b/phpBB/includes/ucp/ucp_attachments.php index b20e4a55ed..ded838aded 100644 --- a/phpBB/includes/ucp/ucp_attachments.php +++ b/phpBB/includes/ucp/ucp_attachments.php @@ -31,6 +31,24 @@ class ucp_attachments if ($delete && sizeof($delete_ids)) { + // Validate $delete_ids... + $sql = 'SELECT attach_id + FROM ' . ATTACHMENTS_TABLE . ' + WHERE poster_id = ' . $user->data['user_id'] . ' + AND is_orphan = 0 + AND ' . $db->sql_in_set('attach_id', $delete_ids); + $result = $db->sql_query($sql); + + $delete_ids = array(); + while ($row = $db->sql_fetchrow($result)) + { + $delete_ids[] = $row['attach_id']; + } + $db->sql_freeresult($result); + } + + if ($delete && sizeof($delete_ids)) + { $s_hidden_fields = array( 'delete' => 1 ); @@ -46,6 +64,7 @@ class ucp_attachments { include_once($phpbb_root_path . 'includes/functions_admin.' . $phpEx); } + delete_attachments('attach', $delete_ids); meta_refresh(3, $this->u_action); |