$Page->title = 'Fout';
}
include_once 'page.inc.php';
+
ob_start();
require '500.inc.html';
$Page->place['debug'] = htmlspecialchars($error);
+ $Page->raw = ob_get_clean();
print $Page->render();
}
"frame-ancestors 'none'", # prevent malicious embedding
])));
-ob_start(); # page body
$Page->place += [
'user' => $User->login ?: '',
'url' => htmlspecialchars($_SERVER['REQUEST_URI']),
# output dynamic and/or static html
-if (!$Page->handler or require("./{$Page->handler}/index.php")) {
- # static contents
- if (isset($Page->raw)) {
- print $Page->raw;
- }
- else {
+ob_start();
+if ($Page->handler and !require("./{$Page->handler}/index.php")) {
+ # replace contents by code output on false return
+ $Page->raw = ob_get_clean();
+}
+else {
+ # keep article contents
+ if (!isset($Page->raw)) {
# no resulting output
http_response_code(404);
@require '404.inc.html';
+ $Page->raw = ob_get_clean();
}
}