From 8a7fb230dae87f4a8945716c6e28ac279297c7f0 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Thu, 8 Jul 2021 11:05:27 +0200 Subject: [PATCH] fix hasHook() which still had some old code --- inc/inc.ClassControllerCommon.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/inc/inc.ClassControllerCommon.php b/inc/inc.ClassControllerCommon.php index ec2bd1cd3..93ed4af67 100644 --- a/inc/inc.ClassControllerCommon.php +++ b/inc/inc.ClassControllerCommon.php @@ -273,10 +273,12 @@ class SeedDMS_Controller_Common { */ function hasHook($hook) { /* {{{ */ $tmps = $this->getHookClassNames(); - if(isset($GLOBALS['SEEDDMS_HOOKS']['controller'][lcfirst($tmp[2])])) { - foreach($GLOBALS['SEEDDMS_HOOKS']['controller'][lcfirst($tmp[2])] as $hookObj) { - if (method_exists($hookObj, $hook)) { - return true; + foreach($tmps as $tmp) { + if(isset($GLOBALS['SEEDDMS_HOOKS']['controller'][lcfirst($tmp)])) { + foreach($GLOBALS['SEEDDMS_HOOKS']['controller'][lcfirst($tmp)] as $hookObj) { + if (method_exists($hookObj, $hook)) { + return true; + } } } }