Fixed $grav['route'] from being modified when the route instance gets modified

This commit is contained in:
Matias Griese
2019-04-24 14:03:55 +03:00
parent 0411c3a98b
commit e9e12392ac
3 changed files with 11 additions and 3 deletions

View File

@@ -1,3 +1,9 @@
# v1.6.9
## mm/dd/2019
1. [](#bugfix)
* Fixed `$grav['route']` from being modified when the route instance gets modified
# v1.6.8
## 04/23/2019

View File

@@ -31,8 +31,8 @@ class RequestServiceProvider implements ServiceProviderInterface
return $creator->fromGlobals();
};
$container['route'] = function() {
return Uri::getCurrentRoute();
};
$container['route'] = $container->factory(function() {
return clone Uri::getCurrentRoute();
});
}
}

View File

@@ -193,6 +193,7 @@ class Route
public function withRoute($route)
{
$this->route = $route;
return $this;
}
@@ -205,6 +206,7 @@ class Route
public function withRoot($root)
{
$this->root = $root;
return $this;
}