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