mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-31 05:50:42 +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:
@@ -145,12 +145,6 @@ $user->session_begin(false);
|
|||||||
$auth->acl($user->data);
|
$auth->acl($user->data);
|
||||||
$user->setup('viewtopic');
|
$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'])
|
if (!$config['allow_attachments'] && !$config['allow_pm_attach'])
|
||||||
{
|
{
|
||||||
send_status_line(404, 'Not Found');
|
send_status_line(404, 'Not Found');
|
||||||
@@ -193,6 +187,11 @@ else if ($topic_id)
|
|||||||
$attachments = $db->sql_fetchrowset($result);
|
$attachments = $db->sql_fetchrowset($result);
|
||||||
$db->sql_freeresult($result);
|
$db->sql_freeresult($result);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
send_status_line(404, 'Not Found');
|
||||||
|
trigger_error('NO_ATTACHMENT_SELECTED');
|
||||||
|
}
|
||||||
|
|
||||||
if (!$attachment && !$attachments)
|
if (!$attachment && !$attachments)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user