summaryrefslogtreecommitdiff
path: root/pages/api.inc
diff options
context:
space:
mode:
Diffstat (limited to 'pages/api.inc')
-rw-r--r--pages/api.inc2
1 files changed, 1 insertions, 1 deletions
diff --git a/pages/api.inc b/pages/api.inc
index 418df76..8bcea02 100644
--- a/pages/api.inc
+++ b/pages/api.inc
@@ -7,7 +7,7 @@ if (str_ends_with($_GET['_'], "/")) {
}
$toplevel = explode("/", $pagename)[1];
-$middlelevel = explode("/", $pagename)[2];
+$middlelevel = explode("/", $pagename)[2] ?? null;
if (isset($middlelevel) && file_exists($_SERVER['DOCUMENT_ROOT'] . "/pages/api/" . $toplevel . "/" . $middlelevel . ".php") && is_file($_SERVER['DOCUMENT_ROOT'] . "/pages/api/" . $toplevel . "/" . $middlelevel . ".php")) {
require_once $_SERVER['DOCUMENT_ROOT'] . "/pages/api/" . $toplevel . "/" . $middlelevel . ".php";