diff --git a/core/constants.php b/core/constants.php index 48d5e24..fa49bcf 100644 --- a/core/constants.php +++ b/core/constants.php @@ -54,6 +54,7 @@ const HTTP_STATUS_DESCRIPTIONS = [ 413 => 'Request Entity Too Large', 414 => 'Request-URI Too Large', 415 => 'Unsupported Media Type', + 418 => 'I\'m a teapot', 500 => 'Internal Server Error', 501 => 'Not Implemented', 502 => 'Bad Gateway', diff --git a/index.php b/index.php index 87e7e55..b0efd3b 100644 --- a/index.php +++ b/index.php @@ -60,8 +60,8 @@ if ($installation) { } if ($router !== null) { - if (!isset($_GET["site"]) && isset($_GET["error"]) && - is_string($_GET["error"]) && preg_match("^\d+$", $_GET["error"])) { + if ((!isset($_GET["site"]) || $_GET["site"] === "/") && isset($_GET["error"]) && + is_string($_GET["error"]) && preg_match("/^\d+$/", $_GET["error"])) { $response = $router->returnStatusCode(intval($_GET["error"])); } else { $response = $router->run($requestedUri);