From: Mischa POSLAWSKY Date: Fri, 8 Jun 2018 16:47:55 +0000 (+0200) Subject: page: apply placeholder replacement to all page output X-Git-Tag: v3.0~6 X-Git-Url: http://git.shiar.net/minimedit.git/commitdiff_plain/85536cb70f85743054b6b3abfc36d05662e6878d page: apply placeholder replacement to all page output --- diff --git a/login/index.php b/login/index.php index 0835133..40fcb61 100644 --- a/login/index.php +++ b/login/index.php @@ -35,8 +35,7 @@ elseif (isset($_GET['logout'])) { if (empty($User)) { ob_clean(); require_once 'login/form.inc.php'; - $part = ['warn' => $message]; - print getoutput($part); + $Place['warn'] = $message; return TRUE; } @@ -48,11 +47,6 @@ if (isset($_GET['goto'])) { exit; } -$part = [ - 'user' => $User['name'], -]; -print getoutput($part); - if (empty($Args) and !empty($User['admin'])) { include_once 'login/admin.html'; include_once 'login/admin/index.php'; diff --git a/page.inc.php b/page.inc.php index 333a705..c4884b9 100644 --- a/page.inc.php +++ b/page.inc.php @@ -1,5 +1,5 @@ \n\n"; # execute dynamic code +$Place = [ + 'user' => $User['name'], + 'url' => htmlspecialchars($_SERVER['REQUEST_URI']), +]; + if ($Page) { $found |= require "./$Page/index.php"; } # global html -include_once 'page.inc.php'; - if (!$found) { # no resulting output http_response_code(404); - ob_start(); @require "./404.html"; - print getoutput([ 'url' => htmlspecialchars($_SERVER['REQUEST_URI']) ]); } +include_once 'page.inc.php'; +