X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FCore%2FAddon.php;h=4c20c96ad4705546ed0ab6c429c0e64351a74f9b;hb=08fc86802a4ad2a265ed45d4e3a6603c65f6c70f;hp=e4acd6e9d36c5d873f9785cf2a72875deb6065b4;hpb=a2cea16954ab9634b10a3d6358a3c5ebad591538;p=friendica.git diff --git a/src/Core/Addon.php b/src/Core/Addon.php index e4acd6e9d3..4c20c96ad4 100644 --- a/src/Core/Addon.php +++ b/src/Core/Addon.php @@ -139,6 +139,8 @@ class Addon */ public static function registerHook($hook, $file, $function, $priority = 0) { + $file = str_replace(get_app()->get_basepath() . DIRECTORY_SEPARATOR, '', $file); + $condition = ['hook' => $hook, 'file' => $file, 'function' => $function]; $exists = DBA::exists('hook', $condition); if ($exists) { @@ -160,7 +162,13 @@ class Addon */ public static function unregisterHook($hook, $file, $function) { + $relative_file = str_replace(get_app()->get_basepath() . DIRECTORY_SEPARATOR, '', $file); + + // This here is only needed for fixing a problem that existed on the develop branch $condition = ['hook' => $hook, 'file' => $file, 'function' => $function]; + DBA::delete('hook', $condition); + + $condition = ['hook' => $hook, 'file' => $relative_file, 'function' => $function]; $r = DBA::delete('hook', $condition); return $r; }