if (file_exists($staticpage)) {
if (is_link($staticpage)) {
$target = preg_replace('/\.html$/', '', readlink($staticpage));
- abort($target, '302 Shorthand');
+ abort($target, '307 Shorthand');
}
}
elseif (file_exists("$request/index.html")) {
$target = urlencode($Page->link);
abort("/login?goto=$target", '303 Eerst inloggen');
}
+ elseif ($check = file_get_contents("{$Page->restricted}/.private")
+ and !$User->admin(trim($check))) {
+ http_response_code(403);
+ $Page->raw('403.inc.html');
+ }
}
# prepare page contents
"base-uri 'self'", # only local pages
"frame-ancestors 'none'", # prevent malicious embedding
])));
+header('Referrer-Policy: no-referrer-when-downgrade');
$Page->place += [
'user' => $User->login ?: '',