]> git.mxchange.org Git - friendica.git/commitdiff
Some redesign
authorMichael <heluecht@pirati.ca>
Sat, 10 Nov 2018 15:20:23 +0000 (15:20 +0000)
committerMichael <heluecht@pirati.ca>
Sat, 10 Nov 2018 15:20:23 +0000 (15:20 +0000)
src/Core/Hook.php

index 73aa95ee908197c3cbc77ebc051ebe9fb7d794e6..2d6c945067965263e45f6a2b879602615e76facd 100644 (file)
@@ -137,19 +137,19 @@ class Hook extends BaseObject
                if (array_key_exists($name, self::$hooks)) {
                        foreach (self::$hooks[$name] as $hook) {
                                // Call a hook to check if this hook call needs to be forked
-                               $hookdata = ['name' => $name, 'data' => $data, 'execute' => true];
-
                                if (array_key_exists('hook_fork', self::$hooks)) {
+                                       $hookdata = ['name' => $name, 'data' => $data, 'execute' => true];
+
                                        foreach (self::$hooks['hook_fork'] as $fork_hook) {
                                                if ($hook[0] != $fork_hook[0]) {
                                                        continue;
                                                }
                                                self::callSingle(self::getApp(), 'hook_fork', $fork_hook, $hookdata);
                                        }
-                               }
 
-                               if (!$hookdata['execute']) {
-                                       continue;
+                                       if (!$hookdata['execute']) {
+                                               continue;
+                                       }
                                }
 
                                Worker::add($priority, 'ForkHook', $name, $hook, $data);