Index: includes/bootstrap.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/bootstrap.inc,v
retrieving revision 1.306
diff -u -p -r1.306 bootstrap.inc
--- includes/bootstrap.inc	21 Sep 2009 08:07:07 -0000	1.306
+++ includes/bootstrap.inc	30 Sep 2009 03:02:25 -0000
@@ -608,7 +608,9 @@ function drupal_settings_initialize() {
  *   The filename of the requested item.
  */
 function drupal_get_filename($type, $name, $filename = NULL) {
-  $files = &drupal_static(__FUNCTION__, array());
+  // The location of files will not change during the request, so do not use
+  // drupal_static().
+  static $files = array();
 
   if (!isset($files[$type])) {
     $files[$type] = array();
@@ -811,7 +813,9 @@ function bootstrap_invoke_all($hook) {
  *   TRUE if the item is loaded or has already been loaded.
  */
 function drupal_load($type, $name) {
-  $files = &drupal_static(__FUNCTION__, array());
+  // Once a file is included this can't be reversed during a request so do not
+  // use drupal_static() here.
+  static $files = array();
 
   if (isset($files[$type][$name])) {
     return TRUE;
