Merge pull request #393 from skipperbent/v4-development

Bugfixes
This commit is contained in:
Simon Sessingø
2018-03-29 23:14:22 +02:00
committed by GitHub
2 changed files with 13 additions and 0 deletions
+5
View File
@@ -510,6 +510,7 @@ class Router
$this->debug('Finished rendering exception-handler');
if (isset($this->loadedExceptionHandlers[$key]) === false && $this->request->hasPendingRewrite() === true) {
$this->loadedExceptionHandlers[$key] = $handler;
$this->debug('Exception handler contains rewrite, reloading routes');
@@ -519,6 +520,10 @@ class Router
'rewriteRoute' => $this->request->getRewriteRoute(),
]);
if ($this->request->getRewriteRoute() !== null) {
$this->processedRoutes[] = $this->request->getRewriteRoute();
}
return $this->routeRequest();
}
+8
View File
@@ -256,6 +256,7 @@ class SimpleRouter
$group = new RouteGroup();
$group->setCallback($callback);
$group->setSettings($settings);
$group = static::addDefaultNamespace($group);
static::router()->addRoute($group);
@@ -283,6 +284,7 @@ class SimpleRouter
$group = new RoutePartialGroup();
$group->setSettings($settings);
$group->setCallback($callback);
$group = static::addDefaultNamespace($group);
static::router()->addRoute($group);
@@ -511,6 +513,12 @@ class SimpleRouter
{
if (static::$defaultNamespace !== null) {
if ($route instanceof IGroupRoute) {
$route->setNamespace(static::$defaultNamespace . '\\' . ltrim($route->getNamespace(), '\\'));
return $route;
}
$callback = $route->getCallback();
/* Only add default namespace on relative callbacks */