summaryrefslogtreecommitdiff
path: root/pages/page.inc
diff options
context:
space:
mode:
Diffstat (limited to 'pages/page.inc')
-rw-r--r--pages/page.inc8
1 files changed, 4 insertions, 4 deletions
diff --git a/pages/page.inc b/pages/page.inc
index 3bdeb2e..7fe039c 100644
--- a/pages/page.inc
+++ b/pages/page.inc
@@ -5,7 +5,7 @@ global $lang; global $pages; global $isLoggedIn; global $isLowerLoggedIn;
$app = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/app.json"), true);
$travelling = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/travelling/travelling.json"), true);
-if (!isset($_GET['_']) || trim($_GET['_']) === "") header("Location: /?error=Invalid request") and die();
+if (!isset($_GET['_']) || trim($_GET['_']) === "") peh_error("Invalid request", 400);
$parts = explode("/", $_GET['_']);
@@ -42,7 +42,7 @@ if (($parts[0] !== "cloudburst" && $parts[0] !== "raindrops" && $parts[0] !== $a
$system = $parts[0];
$member = (isset($parts[1]) ? $parts[1] : null) === "" ? null : (isset($parts[1]) ? $parts[1] : null);
-if ($system !== "cloudburst" && $system !== "raindrops" && ($system !== $app["other"]["slug"] && !$isLowerLoggedIn && !$isLoggedIn)) header("Location: /?error=" . $lang["page"]["system"]) and die();
+if ($system !== "cloudburst" && $system !== "raindrops" && ($system !== $app["other"]["slug"] && !$isLowerLoggedIn && !$isLoggedIn)) peh_error("System not found", 404);
$systemCommonName = $system === "cloudburst" ? "Cloudburst System" : ($system === $app["other"]["slug"] && ($isLoggedIn || $isLowerLoggedIn) ? $app["other"]["name"] : "Raindrops System");
$systemID = $system === "cloudburst" ? "ynmuc" : ($system === $app["other"]["slug"] && ($isLoggedIn || $isLowerLoggedIn) ? $app["other"]["id"] : "gdapd");
@@ -58,7 +58,7 @@ if ($member === null) {
$pageFile = $_SERVER['DOCUMENT_ROOT'] . '/includes/system/' . $parts[2] . '.inc';
require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/system/' . $parts[2] . '.inc';
} else {
- header("Location: /?error=" . $lang["page"]["system"] . " " . $parts[2]) and die();
+ peh_error("System page not found: " . strip_tags($parts[2]), 404);
}
} else {
$memberFoundInAnotherSystem = false;
@@ -105,7 +105,7 @@ if ($member === null) {
$pageFile = $_SERVER['DOCUMENT_ROOT'] . '/includes/member/' . $parts[3] . '.inc';
require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/member/' . $parts[3] . '.inc';
} else {
- header("Location: /?error=" . $lang["page"]["system"] . " " . $parts[3]) and die();
+ peh_error("Member page not found: " . strip_tags($parts[3]), 404);
}
die();
}