diff options
author | Robin Appelman <icewind@owncloud.com> | 2014-06-05 21:08:30 +0200 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2014-06-06 09:56:02 +0200 |
commit | 46f70aabfd399e1bc5517b2192ac2489189f9d94 (patch) | |
tree | 974278abedd023073eec61c7f6d6e9c280271003 | |
parent | 0b2ae314c7ea58c5105070dbcbada2212c3851dc (diff) | |
download | nextcloud-server-46f70aabfd399e1bc5517b2192ac2489189f9d94.tar.gz nextcloud-server-46f70aabfd399e1bc5517b2192ac2489189f9d94.zip |
Dont connect hooks twice
-rw-r--r-- | lib/private/hook.php | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/private/hook.php b/lib/private/hook.php index 30e22847c7f..c9ca58f779e 100644 --- a/lib/private/hook.php +++ b/lib/private/hook.php @@ -31,6 +31,12 @@ class OC_Hook{ self::$registered[$signalclass][$signalname] = array(); } + // dont connect hooks twice + foreach (self::$registered[$signalclass][$signalname] as $hook) { + if ($hook['class'] === $slotclass and $hook['name'] === $slotname) { + return false; + } + } // Connect the hook handler to the requested emitter self::$registered[$signalclass][$signalname][] = array( "class" => $slotclass, |