mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 22:28:51 +00: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:
parent
862502aacd
commit
5986676f4d
1 changed files with 5 additions and 6 deletions
|
@ -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)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue