mirror of
https://github.com/processwire/processwire.git
synced 2025-08-08 15:57:01 +02:00
Fix issue processwire/processwire-issues#121
This commit is contained in:
@@ -276,7 +276,21 @@ class WireHooks {
|
|||||||
protected function isHookedOrParents($class, $method, $type = 'either') {
|
protected function isHookedOrParents($class, $method, $type = 'either') {
|
||||||
|
|
||||||
$property = '';
|
$property = '';
|
||||||
$className = is_object($class) ? wireClassName($class) : $class;
|
if(is_object($class)) {
|
||||||
|
$className = wireClassName($class);
|
||||||
|
$object = $class;
|
||||||
|
} else {
|
||||||
|
$className = $class;
|
||||||
|
$object = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
if($object) {
|
||||||
|
// first check local hooks attached to this instance
|
||||||
|
$localHooks = $object->getLocalHooks();
|
||||||
|
if(!empty($localHooks[rtrim($method, '()')])) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if($type == 'method' || $type == 'either') {
|
if($type == 'method' || $type == 'either') {
|
||||||
if(strpos($method, '(') === false) $method .= '()';
|
if(strpos($method, '(') === false) $method .= '()';
|
||||||
|
Reference in New Issue
Block a user