Fix permission test in Hook::has()
Before, only the first hook for the given type was tested. If this hook belonged to a not permitted module, Hook::has() returned false. Though there may have been other hooks which are permitted.
This commit is contained in:
parent
b3e0b5d587
commit
7e4b92b714
|
@ -75,11 +75,13 @@ class Hook
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$hook = self::$hooks[$name];
|
foreach (self::$hooks[$name] as $hook) {
|
||||||
// $hook is in the format key => value
|
if (self::hasPermission($hook)) {
|
||||||
$hook = reset($hook);
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return self::hasPermission($hook);
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected static function normalizeHookName($name)
|
protected static function normalizeHookName($name)
|
||||||
|
|
Loading…
Reference in New Issue