Index: includes/common.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/common.inc,v retrieving revision 1.1043 diff -u -p -r1.1043 common.inc --- includes/common.inc 8 Nov 2009 12:43:40 -0000 1.1043 +++ includes/common.inc 9 Nov 2009 03:05:47 -0000 @@ -2275,7 +2275,10 @@ function format_interval($timestamp, $gr * A translated date string in the requested format. */ function format_date($timestamp, $type = 'medium', $format = '', $timezone = NULL, $langcode = NULL) { - $timezones = &drupal_static(__FUNCTION__, array()); + static $drupal_static = array(); + isset($drupal_static[__FUNCTION__]) || ($drupal_static[__FUNCTION__] = &drupal_static(__FUNCTION__)); + $timezones = &$drupal_static[__FUNCTION__]; + if (!isset($timezone)) { global $user; if (variable_get('configurable_timezones', 1) && $user->uid && $user->timezone) { @@ -2512,7 +2515,9 @@ function url($path = NULL, array $option } global $base_url, $base_secure_url, $base_insecure_url; - $script = &drupal_static(__FUNCTION__); + static $drupal_static = array(); + isset($drupal_static[__FUNCTION__]) || ($drupal_static[__FUNCTION__] = &drupal_static(__FUNCTION__)); + $script = &$drupal_static[__FUNCTION__]; if (!isset($script)) { // On some web servers, such as IIS, we can't omit "index.php". So, we @@ -4730,7 +4735,9 @@ function drupal_system_listing($mask, $d * keyed array as described above. */ function drupal_alter($type, &$data, &$context1 = NULL, &$context2 = NULL) { - $functions = &drupal_static(__FUNCTION__, array()); + static $drupal_static = array(); + isset($drupal_static[__FUNCTION__]) || ($drupal_static[__FUNCTION__] = &drupal_static(__FUNCTION__)); + $functions = &$drupal_static[__FUNCTION__]; // Some alter hooks are invoked many times per page request, so statically // cache the list of functions to call, and on subsequent calls, iterate @@ -6227,8 +6234,9 @@ function drupal_check_incompatibility($v * to return an array with info about all types. */ function entity_get_info($entity_type = NULL) { - // We statically cache the information returned by hook_entity_info(). - $entity_info = &drupal_static(__FUNCTION__, array()); + static $drupal_static = array(); + isset($drupal_static[__FUNCTION__]) || ($drupal_static[__FUNCTION__] = &drupal_static(__FUNCTION__)); + $entity_info = &$drupal_static[__FUNCTION__]; if (empty($entity_info)) { if ($cache = cache_get('entity_info')) { Index: includes/module.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/module.inc,v retrieving revision 1.169 diff -u -p -r1.169 module.inc --- includes/module.inc 8 Nov 2009 19:53:19 -0000 1.169 +++ includes/module.inc 9 Nov 2009 03:05:47 -0000 @@ -418,7 +418,9 @@ function module_hook($module, $hook) { * @see module_implements_write_cache(). */ function module_implements($hook, $sort = FALSE, $reset = FALSE) { - $implementations = &drupal_static(__FUNCTION__, array()); + static $drupal_static = array(); + isset($drupal_static[__FUNCTION__]) || ($drupal_static[__FUNCTION__] = &drupal_static(__FUNCTION__)); + $implementations = &$drupal_static[__FUNCTION__]; // We maintain a persistent cache of hook implementations in addition to the // static cache to avoid looping through every module and every hook on each Index: includes/path.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/path.inc,v retrieving revision 1.47 diff -u -p -r1.47 path.inc --- includes/path.inc 24 Oct 2009 05:13:43 -0000 1.47 +++ includes/path.inc 9 Nov 2009 03:05:47 -0000 @@ -45,14 +45,20 @@ function drupal_path_initialize() { */ function drupal_lookup_path($action, $path = '', $path_language = '') { global $language; - $cache = &drupal_static(__FUNCTION__, array( - 'map' => array(), - 'no_source' => array(), - 'whitelist' => NULL, - 'system_paths' => array(), - 'no_aliases' => array(), - 'first_call' => TRUE, - )); + static $drupal_static = array(); + isset($drupal_static[__FUNCTION__]) || ($drupal_static[__FUNCTION__] = &drupal_static(__FUNCTION__)); + $cache = &$drupal_static[__FUNCTION__]; + + if (!isset($cache)) { + $cache = array( + 'map' => array(), + 'no_source' => array(), + 'whitelist' => NULL, + 'system_paths' => array(), + 'no_aliases' => array(), + 'first_call' => TRUE, + ); + } // Retrieve the path alias whitelist. if (!isset($cache['whitelist'])) { @@ -245,7 +251,9 @@ function drupal_get_normal_path($path, $ * not found. */ function arg($index = NULL, $path = NULL) { - $arguments = &drupal_static(__FUNCTION__); + static $drupal_static = array(); + isset($drupal_static[__FUNCTION__]) || ($drupal_static[__FUNCTION__] = &drupal_static(__FUNCTION__)); + $arguments = &$drupal_static[__FUNCTION__]; if (!isset($path)) { $path = $_GET['q']; @@ -310,7 +318,9 @@ function drupal_set_title($title = NULL, * Boolean value: TRUE if the current page is the front page; FALSE if otherwise. */ function drupal_is_front_page() { - $is_front_page = &drupal_static(__FUNCTION__); + static $drupal_static = array(); + isset($drupal_static[__FUNCTION__]) || ($drupal_static[__FUNCTION__] = &drupal_static(__FUNCTION__)); + $is_front_page = &$drupal_static[__FUNCTION__]; if (!isset($is_front_page)) { // As drupal_path_initialize updates $_GET['q'] with the 'site_frontpage' path, Index: modules/user/user.module =================================================================== RCS file: /cvs/drupal/drupal/modules/user/user.module,v retrieving revision 1.1077 diff -u -p -r1.1077 user.module --- modules/user/user.module 7 Nov 2009 14:27:20 -0000 1.1077 +++ modules/user/user.module 9 Nov 2009 03:05:47 -0000 @@ -673,7 +673,9 @@ function user_role_permissions($roles = */ function user_access($string, $account = NULL) { global $user; - $perm = &drupal_static(__FUNCTION__, array()); + static $drupal_static = array(); + isset($drupal_static[__FUNCTION__]) || ($drupal_static[__FUNCTION__] = &drupal_static(__FUNCTION__)); + $perm = &$drupal_static[__FUNCTION__]; if (!isset($account)) { $account = $user;