page: restore meta tags for editors
authorMischa POSLAWSKY <perl@shiar.org>
Wed, 20 Nov 2019 23:31:27 +0000 (00:31 +0100)
committerMischa POSLAWSKY <perl@shiar.org>
Mon, 25 Nov 2019 20:14:17 +0000 (21:14 +0100)
page.php

index 1488f1c5904f7a637208305037bfd73bb02e7861..932e72943b4f8b1ee1d35c7f512407141d481b32 100644 (file)
--- a/page.php
+++ b/page.php
@@ -179,6 +179,15 @@ $Place = [
 ];
 
 if (isset($Article->raw)) {
+       if ($User and $User->admin("edit $Page$Args")) {
+               # restore meta tags in static contents for editing
+               foreach (array_reverse($Article->meta) as $metaprop => $val) {
+                       $Article->raw = sprintf(
+                               '<meta property="%s" content="%s" />'."\n",
+                               $metaprop, $val
+                       ) . $Article->raw;
+               }
+       }
        $Article->raw = '<div class="static">'."\n\n".$Article->raw."</div>\n\n";
 }