From 471827cb3143fc55f4e280128dad063c9e876a59 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 fc16521cf32..209ea5c876d 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; } -- 2.39.5