aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/download/file.php
diff options
context:
space:
mode:
authorAndreas Fischer <bantu@phpbb.com>2012-08-07 00:33:23 +0200
committerAndreas Fischer <bantu@phpbb.com>2012-08-07 00:33:23 +0200
commit5986676f4dd59f9b5c69a37ee392575d7f7f0375 (patch)
tree527b4362aa6444ab1a1a6ac2013252bea4f649de /phpBB/download/file.php
parent862502aacd36918ba9c9d5524e625c02a3830897 (diff)
downloadforums-5986676f4dd59f9b5c69a37ee392575d7f7f0375.tar
forums-5986676f4dd59f9b5c69a37ee392575d7f7f0375.tar.gz
forums-5986676f4dd59f9b5c69a37ee392575d7f7f0375.tar.bz2
forums-5986676f4dd59f9b5c69a37ee392575d7f7f0375.tar.xz
forums-5986676f4dd59f9b5c69a37ee392575d7f7f0375.zip
[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
Diffstat (limited to 'phpBB/download/file.php')
-rw-r--r--phpBB/download/file.php11
1 files 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)
{