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;
|
||||
}
|
||||
|
||||
$hook = self::$hooks[$name];
|
||||
// $hook is in the format key => value
|
||||
$hook = reset($hook);
|
||||
foreach (self::$hooks[$name] as $hook) {
|
||||
if (self::hasPermission($hook)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return self::hasPermission($hook);
|
||||
return false;
|
||||
}
|
||||
|
||||
protected static function normalizeHookName($name)
|
||||
|
|
Loading…
Reference in New Issue