1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-03-14 20:50:30 +01:00

[ticket/9609] Change header() calls setting HTTP status to send_status_line().

PHPBB3-9609
This commit is contained in:
Andreas Fischer 2010-09-11 21:55:11 +02:00
parent fecca4ef21
commit bef108a5cc
3 changed files with 14 additions and 13 deletions

View File

@ -77,7 +77,7 @@ if (isset($_GET['avatar']))
// '==' is not a bug - . as the first char is as bad as no dot at all // '==' is not a bug - . as the first char is as bad as no dot at all
if (strpos($filename, '.') == false) if (strpos($filename, '.') == false)
{ {
header('HTTP/1.0 403 Forbidden'); send_status_line(403, 'Forbidden');
$exit = true; $exit = true;
} }
@ -91,7 +91,7 @@ if (isset($_GET['avatar']))
if (!$exit && !in_array($ext, array('png', 'gif', 'jpg', 'jpeg'))) if (!$exit && !in_array($ext, array('png', 'gif', 'jpg', 'jpeg')))
{ {
// no way such an avatar could exist. They are not following the rules, stop the show. // no way such an avatar could exist. They are not following the rules, stop the show.
header("HTTP/1.0 403 Forbidden"); send_status_line(403, 'Forbidden');
$exit = true; $exit = true;
} }
@ -101,7 +101,7 @@ if (isset($_GET['avatar']))
if (!$filename) if (!$filename)
{ {
// no way such an avatar could exist. They are not following the rules, stop the show. // no way such an avatar could exist. They are not following the rules, stop the show.
header("HTTP/1.0 403 Forbidden"); send_status_line(403, 'Forbidden');
} }
else else
{ {
@ -199,7 +199,7 @@ else
$row['forum_id'] = false; $row['forum_id'] = false;
if (!$auth->acl_get('u_pm_download')) if (!$auth->acl_get('u_pm_download'))
{ {
header('HTTP/1.0 403 Forbidden'); send_status_line(403, 'Forbidden');
trigger_error('SORRY_AUTH_VIEW_ATTACH'); trigger_error('SORRY_AUTH_VIEW_ATTACH');
} }
@ -222,7 +222,7 @@ else
if (!$allowed) if (!$allowed)
{ {
header('HTTP/1.0 403 Forbidden'); send_status_line(403, 'Forbidden');
trigger_error('ERROR_NO_ATTACHMENT'); trigger_error('ERROR_NO_ATTACHMENT');
} }
} }
@ -237,7 +237,7 @@ else
if (!download_allowed()) if (!download_allowed())
{ {
header('HTTP/1.0 403 Forbidden'); send_status_line(403, 'Forbidden');
trigger_error($user->lang['LINKAGE_FORBIDDEN']); trigger_error($user->lang['LINKAGE_FORBIDDEN']);
} }
@ -383,7 +383,7 @@ function send_avatar_to_browser($file, $browser)
} }
else else
{ {
header('HTTP/1.0 404 Not Found'); send_status_line(404, 'Not Found');
} }
} }

View File

@ -3753,7 +3753,7 @@ function msg_handler($errno, $msg_text, $errfile, $errline)
} }
// Do not send 200 OK, but service unavailable on errors // Do not send 200 OK, but service unavailable on errors
header('HTTP/1.1 503 Service Unavailable'); send_status_line(503, 'Service Unavailable');
garbage_collection(); garbage_collection();
@ -4223,7 +4223,8 @@ function phpbb_http_login($param)
} }
else if ($auth_result['status'] == LOGIN_ERROR_ATTEMPTS) else if ($auth_result['status'] == LOGIN_ERROR_ATTEMPTS)
{ {
header('HTTP/1.0 401 Unauthorized'); send_status_line(401, 'Unauthorized');
trigger_error('NOT_AUTHORISED'); trigger_error('NOT_AUTHORISED');
} }
} }
@ -4235,7 +4236,7 @@ function phpbb_http_login($param)
$param['auth_message'] = preg_replace('/[\x80-\xFF]/', '?', $param['auth_message']); $param['auth_message'] = preg_replace('/[\x80-\xFF]/', '?', $param['auth_message']);
header('WWW-Authenticate: Basic realm="' . $param['auth_message'] . '"'); header('WWW-Authenticate: Basic realm="' . $param['auth_message'] . '"');
header('HTTP/1.0 401 Unauthorized'); send_status_line(401, 'Unauthorized');
trigger_error('NOT_AUTHORISED'); trigger_error('NOT_AUTHORISED');
} }

View File

@ -748,7 +748,7 @@ class session
if ((int) $row['sessions'] > (int) $config['active_sessions']) if ((int) $row['sessions'] > (int) $config['active_sessions'])
{ {
header('HTTP/1.1 503 Service Unavailable'); send_status_line(503, 'Service Unavailable');
trigger_error('BOARD_UNAVAILABLE'); trigger_error('BOARD_UNAVAILABLE');
} }
} }
@ -1821,7 +1821,7 @@ class user extends session
{ {
if ($this->data['is_bot']) if ($this->data['is_bot'])
{ {
header('HTTP/1.1 503 Service Unavailable'); send_status_line(503, 'Service Unavailable');
} }
$message = (!empty($config['board_disable_msg'])) ? $config['board_disable_msg'] : 'BOARD_DISABLE'; $message = (!empty($config['board_disable_msg'])) ? $config['board_disable_msg'] : 'BOARD_DISABLE';
@ -1840,7 +1840,7 @@ class user extends session
{ {
if ($this->data['is_bot']) if ($this->data['is_bot'])
{ {
header('HTTP/1.1 503 Service Unavailable'); send_status_line(503, 'Service Unavailable');
} }
trigger_error('BOARD_UNAVAILABLE'); trigger_error('BOARD_UNAVAILABLE');
} }