From 297195ea7cb59ede5d39d7f3c56fdfd2ead376f7 Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Sat, 9 Jun 2018 00:50:33 +0200 Subject: [PATCH] page: set placeholder after page script User may be set or changed by login. --- page.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/page.php b/page.php index 7c4f8b1..554735c 100644 --- a/page.php +++ b/page.php @@ -145,15 +145,17 @@ print "\n\n"; # execute dynamic code -$Place = [ - 'user' => $User['name'], - 'url' => htmlspecialchars($_SERVER['REQUEST_URI']), -]; +$Place = []; if ($Page) { $found |= require "./$Page/index.php"; } +$Place += [ + 'user' => $User ? $User['name'] : '', + 'url' => htmlspecialchars($_SERVER['REQUEST_URI']), +]; + # global html if (!$found) { -- 2.30.0