From 62b5ff32fa1e2ad7361940351bd6585b9dfcbd9a Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Fri, 4 Dec 2020 23:50:39 +0100 Subject: [PATCH] page: prepend 404 contents to admin template Preview actual output on edit. --- page.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/page.php b/page.php index 8d2d01c..ba58306 100644 --- a/page.php +++ b/page.php @@ -111,6 +111,7 @@ if (!isset($Page->raw) and $User->admin("edit {$Page->link}")) { $Page->raw($template); $Page->meta['article:published_time'] = date('Y-m-d h:i:s O'); $Page->meta['article:author'] = '/' . $User->dir; + $Page->body = NULL; } if (isset($Page->raw)) { @@ -135,11 +136,11 @@ if ($Page->handler and !require("./{$Page->handler}/index.php")) { } else { # keep article contents - if (!isset($Page->raw)) { + if (!isset($Page->body)) { # no resulting output http_response_code(404); @require '404.inc.html'; - $Page->raw = ob_get_clean(); + $Page->raw = ob_get_clean() . $Page->raw; } } -- 2.30.0