Commit e98e818a authored by Dries's avatar Dries

- Patch #1216758 by tim.plunkett: and as formal parameters in module_invoke().

parent d902c2f2
......@@ -786,10 +786,9 @@ function module_implements_write_cache() {
* @return
* The return value of the hook implementation.
*/
function module_invoke() {
function module_invoke($module, $hook) {
$args = func_get_args();
$module = $args[0];
$hook = $args[1];
// Remove $module and $hook from the arguments.
unset($args[0], $args[1]);
if (module_hook($module, $hook)) {
return call_user_func_array($module . '_' . $hook, $args);
......@@ -808,9 +807,9 @@ function module_invoke() {
* An array of return values of the hook implementations. If modules return
* arrays from their implementations, those are merged into one array.
*/
function module_invoke_all() {
function module_invoke_all($hook) {
$args = func_get_args();
$hook = $args[0];
// Remove $hook from the arguments.
unset($args[0]);
$return = array();
foreach (module_implements($hook) as $module) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment