From 5986676f4dd59f9b5c69a37ee392575d7f7f0375 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Tue, 7 Aug 2012 00:33:23 +0200 Subject: [PATCH] [feature/attach-dl] Exploit the "if ... else if ..." for the error message. Use an "else" statement instead of checking everything at the top. PHPBB3-11042 --- phpBB/download/file.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/phpBB/download/file.php b/phpBB/download/file.php index bd96ad02f7..bddd6a27aa 100644 --- a/phpBB/download/file.php +++ b/phpBB/download/file.php @@ -145,12 +145,6 @@ $user->session_begin(false); $auth->acl($user->data); $user->setup('viewtopic'); -if (!$download_id && !$post_id && !$topic_id) -{ - send_status_line(404, 'Not Found'); - trigger_error('NO_ATTACHMENT_SELECTED'); -} - if (!$config['allow_attachments'] && !$config['allow_pm_attach']) { send_status_line(404, 'Not Found'); @@ -193,6 +187,11 @@ else if ($topic_id) $attachments = $db->sql_fetchrowset($result); $db->sql_freeresult($result); } +else +{ + send_status_line(404, 'Not Found'); + trigger_error('NO_ATTACHMENT_SELECTED'); +} if (!$attachment && !$attachments) {