From 6fb553e92cd62926134f4f77a3069fa4439835fe Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Wed, 21 Jan 2015 22:27:59 +0100 Subject: Do not call wrapStorage if storate with same name added twice --- lib/private/files/storage/storagefactory.php | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/private/files/storage/storagefactory.php') diff --git a/lib/private/files/storage/storagefactory.php b/lib/private/files/storage/storagefactory.php index c9e8d422f9d..9c1c7325b76 100644 --- a/lib/private/files/storage/storagefactory.php +++ b/lib/private/files/storage/storagefactory.php @@ -23,9 +23,15 @@ class StorageFactory implements IStorageFactory { * * @param string $wrapperName * @param callable $callback + * @return true if the wrapper was added, false if there was already a wrapper with this + * name registered */ public function addStorageWrapper($wrapperName, $callback) { + if (isset($this->storageWrappers[$wrapperName])) { + return false; + } $this->storageWrappers[$wrapperName] = $callback; + return true; } /** -- cgit v1.2.3