From 50f9b29cc21f5adef555d3cf21940124ceadb0eb Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Fri, 4 Dec 2020 01:30:17 +0100 Subject: [PATCH] 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. --- article.inc.php | 2 +- nieuws/index.php | 2 +- page.inc.php | 6 +----- page.php | 18 +++++++++++------- widget/nieuws.php | 1 + widget/page.php | 2 -- 6 files changed, 15 insertions(+), 16 deletions(-) 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 '