[BUGFIX] Bugfixes and optimisations

- Fixed issue causing nested groups not merging namespace correctly.
- Fixed issue causing longer urls (for example: /route) to have higher priority than (/route/match) in some cases.
This commit is contained in:
Simon Sessingø
2016-04-07 23:16:50 +02:00
parent 27371dfa11
commit 975c27659c
2 changed files with 9 additions and 1 deletions
+8
View File
@@ -135,6 +135,14 @@ class RouterBase {
$routeNotAllowed = false;
// Make sure routes with longer urls are rendered first
usort($this->controllerUrlMap, function($a, $b) {
if(strlen($a->getUrl()) < strlen($b->getUrl())) {
return 1;
}
return -1;
});
$max = count($this->controllerUrlMap);
/* @var $route RouterEntry */