]> source.dussan.org Git - nextcloud-server.git/commitdiff
Make sure all middlewares are only registered once 15385/head
authorJoas Schilling <coding@schilljs.com>
Mon, 6 May 2019 09:28:18 +0000 (11:28 +0200)
committerJoas Schilling <coding@schilljs.com>
Mon, 6 May 2019 09:28:18 +0000 (11:28 +0200)
Signed-off-by: Joas Schilling <coding@schilljs.com>
lib/private/AppFramework/DependencyInjection/DIContainer.php

index fc16521cf32773d44014a89147a095e779f1d73e..209ea5c876d7e75bef714bbae42ed5c37fd08ff2 100644 (file)
@@ -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;
        }