diff options
author | Minteck <contact@minteck.org> | 2023-02-23 19:34:56 +0100 |
---|---|---|
committer | Minteck <contact@minteck.org> | 2023-02-23 19:34:56 +0100 |
commit | 3d1cd02f27518f1a04374c7c8320cd5d82ede6e9 (patch) | |
tree | 75be5fba4368472fb11c8015aee026b2b9a71888 /app.php | |
parent | 8cc1f13c17fa2fb5a4410542d39e650e02945634 (diff) | |
download | pluralconnect-3d1cd02f27518f1a04374c7c8320cd5d82ede6e9.tar.gz pluralconnect-3d1cd02f27518f1a04374c7c8320cd5d82ede6e9.tar.bz2 pluralconnect-3d1cd02f27518f1a04374c7c8320cd5d82ede6e9.zip |
Updated 40 files, added 37 files, deleted 1103 files and renamed 3905 files (automated)
Diffstat (limited to 'app.php')
-rw-r--r-- | app.php | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -1,7 +1,10 @@ <?php +ob_start(); + require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/language.inc"; global $lang; global $pages; require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.inc"; global $isLoggedIn; global $isLowerLoggedIn; +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/functions.inc"; $app = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/app.json"), true); @@ -18,7 +21,7 @@ if (in_array($toplevel, ["editor", "icons", "species", "uploads"])) { if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/" . $toplevel . "/" . $filename)) { header("Location: /assets/" . $toplevel . "/" . $filename) and die(); } else { - header("Location: /?error=" . $lang["app"]["file"]) and die(); + peh_error("File not found", 404); } } elseif ($toplevel === "") { $pageFile = $_SERVER['DOCUMENT_ROOT'] . "/pages/home.inc"; @@ -32,7 +35,7 @@ if (in_array($toplevel, ["editor", "icons", "species", "uploads"])) { $pageFile = $_SERVER['DOCUMENT_ROOT'] . "/pages/" . $toplevel . ".inc"; require_once $_SERVER['DOCUMENT_ROOT'] . "/pages/" . $toplevel . ".inc"; } else { - header("Location: /?error=" . $lang["app"]["page"] . " " . strip_tags($pagename)) and die(); + peh_error("Page not found: " . strip_tags($pagename), 404); } } else if ($toplevel === "api") { if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/pages/" . $toplevel . ".inc")) { |