From: Mischa POSLAWSKY Date: Fri, 4 Dec 2020 22:50:39 +0000 (+0100) Subject: page: prepend 404 contents to admin template X-Git-Tag: v5.0~36 X-Git-Url: http://git.shiar.nl/minimedit.git/commitdiff_plain/62b5ff32fa1e2ad7361940351bd6585b9dfcbd9a page: prepend 404 contents to admin template Preview actual output on edit. --- 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; } }