X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FCore%2FAddon.php;h=50247d240f42fbffb1480493273b3416412c59a4;hb=12d0f4bf3c17fb650036e301bb677ff736d5c178;hp=a3bfeec32b34a9745b7acea18c8940b8675186d7;hpb=f68667e301728426923a3e4abf07dcf32b002f9f;p=friendica.git diff --git a/src/Core/Addon.php b/src/Core/Addon.php index a3bfeec32b..50247d240f 100644 --- a/src/Core/Addon.php +++ b/src/Core/Addon.php @@ -228,14 +228,15 @@ class Addon /** * @brief Calls a single hook. * - * @param string $name of the hook to call - * @param array $hook Hook data - * @param string|array &$data to transmit to the callback handler + * @param \Friendica\App $a + * @param string $name of the hook to call + * @param array $hook Hook data + * @param string|array &$data to transmit to the callback handler */ - public static function callSingleHook($a, $name, $hook, &$data = null) + public static function callSingleHook(\Friendica\App $a, $name, $hook, &$data = null) { // Don't run a theme's hook if the user isn't using the theme - if (strpos($hook[0], 'view/theme/') !== false && strpos($hook[0], 'view/theme/'.current_theme()) === false) { + if (strpos($hook[0], 'view/theme/') !== false && strpos($hook[0], 'view/theme/' . $a->getCurrentTheme()) === false) { return; } @@ -246,7 +247,7 @@ class Addon } else { // remove orphan hooks $condition = ['hook' => $name, 'file' => $hook[0], 'function' => $hook[1]]; - dba::delete('hook', $condition); + dba::delete('hook', $condition, ['cascade' => false]); } }