diff options
Diffstat (limited to 'index.php')
-rw-r--r-- | index.php | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/index.php b/index.php index b66281e6449..f0e763f797c 100644 --- a/index.php +++ b/index.php @@ -54,7 +54,7 @@ try { \OC::$server->getLogger()->logException($ex2, array('app' => 'index')); //show the user a detailed error page - OC_Template::printExceptionErrorPage($ex, \OC_Response::STATUS_INTERNAL_SERVER_ERROR); + OC_Template::printExceptionErrorPage($ex, 500); } } catch (\OC\User\LoginException $ex) { OC_Template::printErrorPage($ex->getMessage(), $ex->getMessage(), OC_Response::STATUS_FORBIDDEN); @@ -62,24 +62,12 @@ try { \OC::$server->getLogger()->logException($ex, array('app' => 'index')); //show the user a detailed error page - OC_Response::setStatus(OC_Response::STATUS_INTERNAL_SERVER_ERROR); - OC_Template::printExceptionErrorPage($ex); + OC_Template::printExceptionErrorPage($ex, 500); } catch (Error $ex) { try { \OC::$server->getLogger()->logException($ex, array('app' => 'index')); } catch (Error $e) { - - $claimedProtocol = strtoupper($_SERVER['SERVER_PROTOCOL']); - $validProtocols = [ - 'HTTP/1.0', - 'HTTP/1.1', - 'HTTP/2', - ]; - $protocol = 'HTTP/1.1'; - if(in_array($claimedProtocol, $validProtocols, true)) { - $protocol = $claimedProtocol; - } - header($protocol . ' 500 Internal Server Error'); + http_response_code(500); header('Content-Type: text/plain; charset=utf-8'); print("Internal Server Error\n\n"); print("The server encountered an internal error and was unable to complete your request.\n"); |