From af5d5f4037aabc493afa60a5394ab3f8f6134917 Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Tue, 29 Dec 2020 01:53:49 +0100 Subject: [PATCH] page: call handler through index method --- article.inc.php | 8 ++++---- issue/index.php | 2 +- page.php | 2 +- widget/sitemap.php | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/article.inc.php b/article.inc.php index 1dbda25..f14de99 100644 --- a/article.inc.php +++ b/article.inc.php @@ -66,16 +66,16 @@ class ArchiveArticle return; } - function index() + function index($api = TRUE) { $this->handler; if (empty($this->handler)) { return; } - $this->api = TRUE; + $this->api = $api; $Page = $this; - $res = include "./{$this->handler}/index.php"; - return $res; + global $User; + return require "./{$this->handler}/index.php"; } function restricted() diff --git a/issue/index.php b/issue/index.php index 62182ac..8b42d11 100644 --- a/issue/index.php +++ b/issue/index.php @@ -1,5 +1,5 @@ path, '/')); diff --git a/page.php b/page.php index dae5081..0c101f8 100644 --- a/page.php +++ b/page.php @@ -69,7 +69,7 @@ if (isset($Page->raw)) { include_once 'format.inc.php'; ob_start(); -if ($Page->handler and !require("./{$Page->handler}/index.php")) { +if ($Page->handler and !$Page->index($Page->api)) { # replace contents by code output on false return $Page->raw = ob_get_clean(); } diff --git a/widget/sitemap.php b/widget/sitemap.php index 35e726f..e4289f8 100644 --- a/widget/sitemap.php +++ b/widget/sitemap.php @@ -4,7 +4,7 @@ $search = new PageSearch($Page->place[0] ?? '.'); print '