Fix module permissions for hooks

refs #2686
This commit is contained in:
Eric Lippmann 2017-01-17 14:56:13 +01:00
parent 326574ba54
commit 01daa38eae
1 changed files with 4 additions and 2 deletions

View File

@ -263,7 +263,7 @@ class Hook
} }
foreach (self::$hooks[$name] as $key => $hook) { foreach (self::$hooks[$name] as $key => $hook) {
if (self::hasPermission($key)) { if (self::hasPermission($hook)) {
if (self::createInstance($name, $key) === null) { if (self::createInstance($name, $key) === null) {
return array(); return array();
} }
@ -286,7 +286,7 @@ class Hook
if (self::has($name)) { if (self::has($name)) {
foreach (self::$hooks[$name] as $key => $hook) { foreach (self::$hooks[$name] as $key => $hook) {
if (self::hasPermission($key)) { if (self::hasPermission($hook)) {
return self::createInstance($name, $key); return self::createInstance($name, $key);
} }
} }
@ -309,6 +309,8 @@ class Hook
self::$hooks[$name] = array(); self::$hooks[$name] = array();
} }
$class = ltrim($class, ClassLoader::NAMESPACE_SEPARATOR);
self::$hooks[$name][$key] = $class; self::$hooks[$name][$key] = $class;
} }
} }