From 5638a5a96b13b91c26f35ac1d860a2c5305e47e9 Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Wed, 2 Dec 2020 23:39:34 +0100 Subject: [PATCH] page: extract metadata after reading template Retain headers in edit if any; prepare for common modification. --- page.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/page.php b/page.php index c5ade11..5aac31f 100644 --- a/page.php +++ b/page.php @@ -170,6 +170,11 @@ $Place = [ 'url' => htmlspecialchars($_SERVER['REQUEST_URI']), ]; +if (!isset($Article->raw) and $User->admin("edit {$Article->link}")) { + # open template as initial contents + $Article->raw(file_exists("$Page/template.inc.html") ? "$Page/template.inc.html" : 'template.inc.html'); +} + if (isset($Article->raw)) { if ($User->admin("edit $Page$Args")) { # restore meta tags in static contents for editing @@ -180,11 +185,6 @@ if (isset($Article->raw)) { ) . $Article->raw; } } -} -elseif ($User->admin("edit {$Article->link}")) { - $Article->raw(file_exists("$Page/template.inc.html") ? "$Page/template.inc.html" : 'template.inc.html'); -} -if (isset($Article->raw)) { $Article->raw = '
'."\n\n".$Article->raw."
\n\n"; } -- 2.30.0