diff --git a/public/common.php b/public/common.php index a00f0b09..bece773b 100644 --- a/public/common.php +++ b/public/common.php @@ -6,7 +6,10 @@ set_exception_handler(function ($exception) { // we could do something much better here - e.g. if the user is logged in, and an admin, show a full stack trace etc. if ($exception instanceof CsrfInvalidException) { - http_response_code(419); // HTTP 419 Page Expired. + // 419 is not a registered status code: without an explicit reason phrase + // Apache replaces the status line with "500 Internal Server Error". + // Always HTTP/1.1: mod_php only applies a status line starting with "HTTP/1.". + header('HTTP/1.1 419 Page Expired', true, 419); $title = Config::lang('session_expired_title') ?: 'Session expired'; $message = Config::lang('session_expired_message') ?: 'The page token is no longer valid. Please return and try again.'; $button = Config::lang('session_expired_button') ?: 'Continue';