pkgsrc/www/drupal7/patches/patch-includes_bootstrap.inc
prlw1 cd6684078c Update drupal7 to 7.59nb2
PHP 7.2: Removed deprecated function each().
PHP 7.2: Avoid count() calls on uncountable variables.
PHP 7.2: Removed deprecated create_function() call.
PHP 7.2: Make sure variables are arrays in theme_links().
Fixed theme-settings.php not being loaded on cached forms
2018-10-03 10:58:15 +00:00

22 lines
853 B
PHP

$NetBSD: patch-includes_bootstrap.inc,v 1.1 2018/10/03 10:58:15 prlw1 Exp $
Issue #2925449
Function each() is deprecated since PHP 7.2
commit 28de6772813387bf02a4bf6f75b9119c4c20a3f4
--- includes/bootstrap.inc.orig 2018-04-25 15:32:27.000000000 +0000
+++ includes/bootstrap.inc
@@ -3785,8 +3785,12 @@ function _drupal_shutdown_function() {
chdir(DRUPAL_ROOT);
try {
- while (list($key, $callback) = each($callbacks)) {
+ // Manually iterate over the array instead of using a foreach loop.
+ // A foreach operates on a copy of the array, so any shutdown functions that
+ // were added from other shutdown functions would never be called.
+ while ($callback = current($callbacks)) {
call_user_func_array($callback['callback'], $callback['arguments']);
+ next($callbacks);
}
}
catch (Exception $exception) {