diff options
-rw-r--r-- | lib/private/appframework/dependencyinjection/dicontainer.php | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/private/appframework/dependencyinjection/dicontainer.php b/lib/private/appframework/dependencyinjection/dicontainer.php index 3755d45fa09..e62b72fd973 100644 --- a/lib/private/appframework/dependencyinjection/dicontainer.php +++ b/lib/private/appframework/dependencyinjection/dicontainer.php @@ -89,11 +89,12 @@ class DIContainer extends SimpleContainer implements IAppContainer{ return new SecurityMiddleware($c['API'], $c['Request']); }); - $this['MiddlewareDispatcher'] = $this->share(function($c){ + $middleWares = $this->middleWares; + $this['MiddlewareDispatcher'] = $this->share(function($c) use ($middleWares) { $dispatcher = new MiddlewareDispatcher(); $dispatcher->registerMiddleware($c['SecurityMiddleware']); - foreach($this->middleWares as $middleWare) { + foreach($middleWares as $middleWare) { $dispatcher->registerMiddleware($middleWare); } |