From: Joas Schilling Date: Mon, 6 May 2019 09:28:18 +0000 (+0200) Subject: Make sure all middlewares are only registered once X-Git-Tag: v17.0.0beta1~478^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=471827cb3143fc55f4e280128dad063c9e876a59;p=nextcloud-server.git Make sure all middlewares are only registered once Signed-off-by: Joas Schilling --- 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; }