1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-06-01 03:54:56 +02:00

[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
This commit is contained in:
Andreas Fischer 2012-08-07 00:33:23 +02:00
parent 862502aacd
commit 5986676f4d

View File

@ -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)
{