diff options
-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, |