From 3a2e1ed25eeee3ee4f1b2199a82396f1d8d42d48 Mon Sep 17 00:00:00 2001 From: ruan <2369127-ruany@users.noreply.gitlab.com> Date: Tue, 8 Sep 2020 11:11:13 +0200 Subject: [PATCH] Simple URLs: Fix error on handling regular URLs --- inc/page.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/inc/page.php b/inc/page.php index 612c6fb..38dcbfc 100644 --- a/inc/page.php +++ b/inc/page.php @@ -70,10 +70,14 @@ class Page { if ($settings->simple_urls) { $keys = array_keys($_GET); - $request_path = $keys[0]; - $local_path = substr($request_path, strlen($this->index_base_path)); + if (count($keys) > 0) { + $request_path = $keys[0]; + $local_path = substr($request_path, strlen($this->index_base_path)); - $this->args = explode("/", substr($local_path, strpos($local_path, "/") + 1)); + $this->args = explode("/", substr($local_path, strpos($local_path, "/") + 1)); + } else { + $this->args = array(); + } } } $argc = count($this->args);