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:
Eric Lippmann 2018-08-16 17:03:42 +02:00
parent b3e0b5d587
commit 7e4b92b714
1 changed files with 6 additions and 4 deletions

View File

@ -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)