mirror of
https://github.com/skipperbent/simple-php-router.git
synced 2026-07-11 20:12:14 +00:00
Merge pull request #267 from skipperbent/fix-url
Fixed: return / if all parameters are empty in getUrl method.
This commit is contained in:
@@ -437,6 +437,10 @@ class Router
|
|||||||
throw new \InvalidArgumentException('Invalid type for getParams. Must be array or null');
|
throw new \InvalidArgumentException('Invalid type for getParams. Must be array or null');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($name === '' && $parameters === '') {
|
||||||
|
return '/';
|
||||||
|
}
|
||||||
|
|
||||||
/* Only merge $_GET when all parameters are null */
|
/* Only merge $_GET when all parameters are null */
|
||||||
if ($name === null && $parameters === null && $getParams === null) {
|
if ($name === null && $parameters === null && $getParams === null) {
|
||||||
$getParams = $_GET;
|
$getParams = $_GET;
|
||||||
|
|||||||
Reference in New Issue
Block a user