Plugins: Fix uninstall when hook is without HOOK_ prefix

This commit is contained in:
slawkens
2026-04-24 16:24:06 +02:00
parent ec7079dd57
commit 609cf152af

View File

@@ -870,7 +870,11 @@ class Plugins {
global $hooks; global $hooks;
foreach($plugin_info['hooks'] ?? [] as $name => $info) { foreach($plugin_info['hooks'] ?? [] as $name => $info) {
$hooks->unregister($name, $info['type'], $info['file']); if (str_contains($info['type'], 'HOOK_')) {
$info['type'] = str_replace('HOOK_', '', $info['type']);
}
$hooks->unregister($name, 'HOOK_' . $info['type'], $info['file']);
} }
clearCache(); clearCache();