1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-30 21:40:43 +02:00

[ticket/12171] Send correct status 403 when forbidden and 404 when not found

PHPBB3-12171
This commit is contained in:
Joas Schilling
2014-02-10 12:17:28 +01:00
parent c36b1c16f9
commit ee1c055b70
2 changed files with 11 additions and 7 deletions

View File

@@ -640,10 +640,14 @@ function phpbb_download_handle_forum_auth($db, $auth, $topic_id)
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
if ($row && ($row['topic_visibility'] == ITEM_APPROVED || $auth->acl_get('m_approve', $row['forum_id']))
&& $auth->acl_get('u_download') && $auth->acl_get('f_download', $row['forum_id']))
if ($row && $row['topic_visibility'] != ITEM_APPROVED && !$auth->acl_get('m_approve', $row['forum_id']))
{
if ($row && $row['forum_password'])
send_status_line(404, 'Not Found');
trigger_error('ERROR_NO_ATTACHMENT');
}
else if ($row && $auth->acl_get('u_download') && $auth->acl_get('f_download', $row['forum_id']))
{
if ($row['forum_password'])
{
// Do something else ... ?
login_forum_box($row);