router fix

This commit is contained in:
John Alanbrook 2023-04-17 16:06:06 +00:00
parent 06667852d1
commit e04f1205be

View file

@ -7,17 +7,23 @@ require "parsedown.php";
$tryuri = ltrim("$_SERVER[REQUEST_URI]", '/'); $tryuri = ltrim("$_SERVER[REQUEST_URI]", '/');
$tryuri = strtok($tryuri, "?"); $tryuri = strtok($tryuri, "?");
if (page_locked($tryuri)) {
load_page("404");
}
$site = file_get_contents("site.json"); $site = file_get_contents("site.json");
if (!$site) { if (!$site) {
echo "Need a site.json file to work!"; echo "Need a site.json file to work!";
return false; return false;
} }
$site = json_decode($site, true); $site = json_decode($site, true);
if (page_locked($tryuri)) {
load_page("404");
}
if ($tryuri == "router" || $tryuri == "parsedown") {
load_page("404");
}
$banned_ext = "php|json|md"; $banned_ext = "php|json|md";
if (is_file($tryuri)) { if (is_file($tryuri)) {