diff --git a/app/Router.php b/app/Router.php index 94d3964..176ff35 100644 --- a/app/Router.php +++ b/app/Router.php @@ -32,10 +32,13 @@ class Router { * @return array|false Returns an array containing the target and parameters */ public function match(array $config): array|false { + $extraParams = []; $requestMethod = $_SERVER['REQUEST_METHOD']; $this->requestUrl = $requestUrl = strtok($_SERVER['REQUEST_URI'], '?'); - parse_str(parse_url($_SERVER['REQUEST_URI'], PHP_URL_QUERY), $extraParams); + if (!empty(parse_url($_SERVER['REQUEST_URI'], PHP_URL_QUERY))) { + parse_str(parse_url($_SERVER['REQUEST_URI'], PHP_URL_QUERY), $extraParams); + } foreach ($this->routes as $route) { list($method, $url, $target) = $route;