mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
Dont connect hooks twice
This commit is contained in:
parent
0b2ae314c7
commit
46f70aabfd
1 changed files with 6 additions and 0 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in a new issue