Commit 8861a546 authored by xjm's avatar xjm

Issue #2575105 by alexpott: hotfix for PHP 5 test failures in ShutdownFunctionsTest

parent 04a706f6
......@@ -1033,8 +1033,12 @@ function _drupal_shutdown_function() {
chdir(DRUPAL_ROOT);
try {
foreach ($callbacks as &$callback) {
reset($callbacks);
// Do not use foreach() here because it is possible that the callback will
// add to the $callbacks array via drupal_register_shutdown_function().
while ($callback = current($callbacks)) {
call_user_func_array($callback['callback'], $callback['arguments']);
next($callbacks);
}
}
// PHP 7 introduces Throwable, which covers both Error and
......
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