diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2009-11-15 21:41:06 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2009-11-15 21:41:06 +0000 |
commit | e1d4dc7d6e37749e4642cbcaf236f26d01c9a0bc (patch) | |
tree | 5a360d1af2ca88547d13ea68c9fb1cd7822a0cf6 /includes | |
parent | 7fb94bda0d2c8e05edbfb02f335a5f27e0af780f (diff) | |
download | brdo-e1d4dc7d6e37749e4642cbcaf236f26d01c9a0bc.tar.gz brdo-e1d4dc7d6e37749e4642cbcaf236f26d01c9a0bc.tar.bz2 |
#620688 follow-up by chx and effulgentsia: Fixed drupal_static_reset() is broken, with expanded test coverage.
Diffstat (limited to 'includes')
-rw-r--r-- | includes/bootstrap.inc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/includes/bootstrap.inc b/includes/bootstrap.inc index 81598b5c9..bc13133ca 100644 --- a/includes/bootstrap.inc +++ b/includes/bootstrap.inc @@ -2100,8 +2100,12 @@ function registry_rebuild() { function &drupal_static($name, $default_value = NULL, $reset = FALSE) { static $data = array(), $default = array(); if (!isset($name)) { - // All variables are reset. - $data = $default; + // All variables are reset. This needs to be done one at a time so that + // references returned by earlier invocations of drupal_static() also get + // reset. + foreach ($default as $name => $value) { + $data[$name] = $value; + } // As the function returns a reference, the return should always be a // variable. return $data; |