From 50827582b6288c987463be4530ee7950ade05215 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Mon, 6 May 2019 11:28:18 +0200 Subject: [PATCH] Make sure all middlewares are only registered once Signed-off-by: Joas Schilling --- lib/private/AppFramework/DependencyInjection/DIContainer.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/private/AppFramework/DependencyInjection/DIContainer.php b/lib/private/AppFramework/DependencyInjection/DIContainer.php index fc16521cf3..209ea5c876 100644 --- a/lib/private/AppFramework/DependencyInjection/DIContainer.php +++ b/lib/private/AppFramework/DependencyInjection/DIContainer.php @@ -299,6 +299,9 @@ class DIContainer extends SimpleContainer implements IAppContainer { * @return boolean|null */ public function registerMiddleWare($middleWare) { + if (in_array($middleWare, $this->middleWares, true) !== false) { + return false; + } $this->middleWares[] = $middleWare; }