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';
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());
}
}