From 60d382df4c9ce50447b07abf04ed97a6319b14b0 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Tue, 7 Aug 2012 02:10:15 +0200 Subject: [PATCH] [feature/attach-dl] Putting some old code under "else if ($download_id)". PHPBB3-11042 --- phpBB/download/file.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/phpBB/download/file.php b/phpBB/download/file.php index 75ff708b16..4f6bc6738c 100644 --- a/phpBB/download/file.php +++ b/phpBB/download/file.php @@ -193,13 +193,19 @@ if (empty($attachments)) } else if ($download_id) { + // sizeof($attachments) == 1 $attachment = current($attachments); -} -if ($attachment && ((!$attachment['in_message'] && !$config['allow_attachments']) || ($attachment['in_message'] && !$config['allow_pm_attach']))) + // in_message = 1 means it's in a private message + if (!$attachment['in_message'] && !$config['allow_attachments'] || $attachment['in_message'] && !$config['allow_pm_attach']) + { + send_status_line(404, 'Not Found'); + trigger_error('ATTACHMENT_FUNCTIONALITY_DISABLED'); + } +} +else { - send_status_line(404, 'Not Found'); - trigger_error('ATTACHMENT_FUNCTIONALITY_DISABLED'); + // sizeof($attachments) > 1 } $row = array();