Merge pull request #15399 from nextcloud/backport/15385/stable16

[stable16] Make sure all middlewares are only registered once
This commit is contained in:
blizzz 2019-05-07 09:42:56 +02:00 committed by GitHub
commit e719bd595f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View 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;
}