[BUGFIX] Only render group if prefix matches.

This commit is contained in:
Simon Sessingø
2016-03-16 19:57:54 +01:00
parent c4fcf750d4
commit db78135d19
2 changed files with 7 additions and 8 deletions
+1 -7
View File
@@ -86,7 +86,7 @@ class RouterBase {
$this->currentRoute = $route;
if($route instanceof RouterGroup && is_callable($route->getCallback())) {
if($route instanceof RouterGroup && $route->matchRoute($this->request) && is_callable($route->getCallback())) {
$group = $route;
$route->renderRoute($this->request);
$mergedSettings = array_merge($route->getMergeableSettings(), $settings);
@@ -126,12 +126,6 @@ class RouterBase {
$route = $this->controllerUrlMap[$i];
if($route->getGroup() !== null) {
if($route->getGroup()->matchDomain($this->request) === false) {
continue;
}
}
$routeMatch = $route->matchRoute($this->request);
if($routeMatch) {
+6 -1
View File
@@ -66,7 +66,12 @@ class RouterGroup extends RouterEntry {
}
public function matchRoute(Request $request) {
return null;
// Skip if prefix doesn't match
if($this->getPrefix() !== null && stripos($request->getUri(), $this->getPrefix()) === false) {
return false;
}
return $this->matchDomain($request);
}
public function setExceptionHandler($class) {