summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2014-06-05 21:08:30 +0200
committerRobin Appelman <icewind@owncloud.com>2014-06-06 09:56:02 +0200
commit46f70aabfd399e1bc5517b2192ac2489189f9d94 (patch)
tree974278abedd023073eec61c7f6d6e9c280271003
parent0b2ae314c7ea58c5105070dbcbada2212c3851dc (diff)
downloadnextcloud-server-46f70aabfd399e1bc5517b2192ac2489189f9d94.tar.gz
nextcloud-server-46f70aabfd399e1bc5517b2192ac2489189f9d94.zip
Dont connect hooks twice
-rw-r--r--lib/private/hook.php6
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,