login/edit: prepare input restriction for user names
[minimedit.git] / page.php
index 7c4f8b1363101fa091eb40e8ac0ccaaaff21e76a..50e098acaf1c0606e1483bca1886124f04339c31 100644 (file)
--- a/page.php
+++ b/page.php
@@ -145,15 +145,17 @@ print "</div>\n\n";
 
 # execute dynamic code
 
-$Place = [
-       'user'  => $User['name'],
-       'url'   => htmlspecialchars($_SERVER['REQUEST_URI']),
-];
+$Place = [];
 
 if ($Page) {
        $found |= require "./$Page/index.php";
 }
 
+$Place += [
+       'user'  => empty($User) ? '' : $User['name'],
+       'url'   => htmlspecialchars($_SERVER['REQUEST_URI']),
+];
+
 # global html
 
 if (!$found) {