From: Mischa POSLAWSKY Date: Fri, 4 Dec 2020 00:30:17 +0000 (+0100) Subject: page: ignore output buffer in article render X-Git-Tag: v5.0~37 X-Git-Url: http://git.shiar.nl/minimedit.git/commitdiff_plain/50f9b29cc21f5adef555d3cf21940124ceadb0eb page: ignore output buffer in article render Operate on object property [raw] only. Stops preliminary output (such as in nieuws code) being injected inside the html body, probably something to restore later for improved behaviour of errors and broken code. --- diff --git a/article.inc.php b/article.inc.php index cff69ff..47a08a7 100644 --- a/article.inc.php +++ b/article.inc.php @@ -207,7 +207,7 @@ class ArchiveArticle function render() { - $doc = ob_get_clean(); + $doc = $this->raw; if (!empty($this->place['warn'])) { $warn = '

[[warn]]

'; diff --git a/nieuws/index.php b/nieuws/index.php index f6e63a4..33b61fb 100644 --- a/nieuws/index.php +++ b/nieuws/index.php @@ -3,7 +3,7 @@ $replyform = $Page->handler == 'melding' && $User->login; @list ($year, $page) = explode('/', trim($Page->path, '/')); if ($User->admin("edit {$Page->handler}")) { - print ''."\n"; + $Page->raw = ''."\n" . $Page->raw; } if ($page and !is_numeric($page)) { diff --git a/page.inc.php b/page.inc.php index afaa970..8eba91b 100644 --- a/page.inc.php +++ b/page.inc.php @@ -1,12 +1,8 @@ render(); - include_once 'head.inc.php'; print "
\n"; -ob_start(); $menu = new ArchiveArticle('menu.inc.html'); -print $menu->raw; ob_start(); if ($User and property_exists($User, 'login') and $User->login) { print '
\n\n"; -print $body; +print $Page->render(); register_shutdown_function(function () { print '