Merge pull request #267 from skipperbent/fix-url

Fixed: return / if all parameters are empty in getUrl method.
This commit is contained in:
Simon Sessingø
2017-08-23 22:17:15 +02:00
committed by GitHub
+4
View File
@@ -437,6 +437,10 @@ class Router
throw new \InvalidArgumentException('Invalid type for getParams. Must be array or null');
}
if ($name === '' && $parameters === '') {
return '/';
}
/* Only merge $_GET when all parameters are null */
if ($name === null && $parameters === null && $getParams === null) {
$getParams = $_GET;