Test empty var
This commit is contained in:
parent
2aa3bce5f7
commit
2ab152e158
1 changed files with 4 additions and 1 deletions
|
@ -32,10 +32,13 @@ class Router {
|
||||||
* @return array|false Returns an array containing the target and parameters
|
* @return array|false Returns an array containing the target and parameters
|
||||||
*/
|
*/
|
||||||
public function match(array $config): array|false {
|
public function match(array $config): array|false {
|
||||||
|
$extraParams = [];
|
||||||
$requestMethod = $_SERVER['REQUEST_METHOD'];
|
$requestMethod = $_SERVER['REQUEST_METHOD'];
|
||||||
$this->requestUrl = $requestUrl = strtok($_SERVER['REQUEST_URI'], '?');
|
$this->requestUrl = $requestUrl = strtok($_SERVER['REQUEST_URI'], '?');
|
||||||
|
|
||||||
|
if (!empty(parse_url($_SERVER['REQUEST_URI'], PHP_URL_QUERY))) {
|
||||||
parse_str(parse_url($_SERVER['REQUEST_URI'], PHP_URL_QUERY), $extraParams);
|
parse_str(parse_url($_SERVER['REQUEST_URI'], PHP_URL_QUERY), $extraParams);
|
||||||
|
}
|
||||||
|
|
||||||
foreach ($this->routes as $route) {
|
foreach ($this->routes as $route) {
|
||||||
list($method, $url, $target) = $route;
|
list($method, $url, $target) = $route;
|
||||||
|
|
Loading…
Reference in a new issue