Commit c4fc7f40 authored by Dries's avatar Dries

- Patch #40886 by chx: fixed problem with recursive/nested node API calls...

- Patch #40886 by chx: fixed problem with recursive/nested node API calls manipulating the same array references.
parent ca9aa560
......@@ -142,7 +142,13 @@ function module_implements($hook) {
}
}
return $implementations[$hook];
// The explicit cast forces a copy to be made. This is needed because
// $implementations[$hook] is only a reference to an element of
// $implementations and if there are nested foreaches (due to nested node
// API calls, for example), they would both manipulate the same array's
// references, which causes some modules' hooks not to be called.
// See also http://www.zend.com/zend/art/ref-count.php.
return (array)$implementations[$hook];
}
/**
......
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