diff --git a/common.php b/common.php index d4ad642a0..365df3601 100644 --- a/common.php +++ b/common.php @@ -27,9 +27,6 @@ if (empty($_SERVER['HTTP_REFERER'])) { if (empty($_SERVER['SERVER_NAME'])) { $_SERVER['SERVER_NAME'] = ''; } -if (empty($_SERVER['SERVER_PROTOCOL'])) { - $_SERVER['SERVER_PROTOCOL'] = getenv('SERVER_PROTOCOL') ?? 'HTTP/1.1'; -} if (empty($_SERVER['SERVER_ADDR'])) { $_SERVER['SERVER_ADDR'] = getenv('SERVER_ADDR'); } diff --git a/library/includes/init_bb.php b/library/includes/init_bb.php index 1e52392bc..08e61ad9e 100644 --- a/library/includes/init_bb.php +++ b/library/includes/init_bb.php @@ -446,7 +446,7 @@ if ( * Exit if board is disabled via trigger */ if (($bb_cfg['board_disable'] || file_exists(BB_DISABLED)) && !defined('IN_ADMIN') && !defined('IN_AJAX') && !defined('IN_LOGIN')) { - \TorrentPier\Common\Http::statusCode(503); + header('HTTP/1.0 503 Service Unavailable'); if ($bb_cfg['board_disable']) { // admin lock send_no_cache_headers(); diff --git a/src/Common/Http.php b/src/Common/Http.php deleted file mode 100644 index bb4812ba6..000000000 --- a/src/Common/Http.php +++ /dev/null @@ -1,54 +0,0 @@ - 'Continue', 101 => 'Switching Protocols', 102 => 'Processing', - 200 => 'OK', 201 => 'Created', 202 => 'Accepted', - 203 => 'Non-Authoritative Information', 204 => 'No Content', 205 => 'Reset Content', - 206 => 'Partial Content', 207 => 'Multi-Status', 300 => 'Multiple Choices', - 301 => 'Moved Permanently', 302 => 'Found', 303 => 'See Other', - 304 => 'Not Modified', 305 => 'Use Proxy', 307 => 'Temporary Redirect', - 400 => 'Bad Request', 401 => 'Unauthorized', 402 => 'Payment Required', - 403 => 'Forbidden', 404 => 'Not Found', 405 => 'Method Not Allowed', - 406 => 'Not Acceptable', 407 => 'Proxy Authentication Required', 408 => 'Request Timeout', - 409 => 'Conflict', 410 => 'Gone', 411 => 'Length Required', - 412 => 'Precondition Failed', 413 => 'Request Entity Too Large', 414 => 'Request-URI Too Long', - 415 => 'Unsupported Media Type', 416 => 'Requested Range Not Satisfiable', 417 => 'Expectation Failed', - 422 => 'Unprocessable Entity', 423 => 'Locked', 424 => 'Failed Dependency', - 426 => 'Upgrade Required', 500 => 'Internal Server Error', 501 => 'Not Implemented', - 502 => 'Bad Gateway', 503 => 'Service Unavailable', 504 => 'Gateway Timeout', - 505 => 'HTTP Version Not Supported', 506 => 'Variant Also Negotiates', 507 => 'Insufficient Storage', - 509 => 'Bandwidth Limit Exceeded', 510 => 'Not Extended' - ]; - } - - if ($status_codes[$statusCode] !== null) { - $status_string = $statusCode . ' ' . $status_codes[$statusCode]; - header($_SERVER['SERVER_PROTOCOL'] . ' ' . $status_string, true, $statusCode); - } - } -}