X-Git-Url: http://git.shiar.net/minimedit.git/blobdiff_plain/7333dc046075c7873b15643ecd73f6e3b32c7a79..903ef7aadee5cee917ce10f775a47bcf77658bae:/page.php diff --git a/page.php b/page.php index cb201f2..856a08a 100644 --- a/page.php +++ b/page.php @@ -3,8 +3,11 @@ error_reporting(E_ALL); ini_set('display_errors', TRUE); set_exception_handler(function ($error) { + http_response_code(500); include_once 'page.inc.php'; - include_once '500.php'; + ob_start(); + require_once './500.html'; + print str_replace('[[debug]]', $error, ob_get_clean()); }); include_once 'auth.inc.php'; @@ -60,7 +63,11 @@ if (!$found) { require './template.html'; } else { - require "./404.php"; + http_response_code(404); + ob_start(); + require "./404.html"; + $url = htmlspecialchars($_SERVER['REQUEST_URI']); + print str_replace('[[url]]', $url, ob_get_clean()); } }