diff options
Diffstat (limited to 'modules/user/user.module')
-rw-r--r-- | modules/user/user.module | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/modules/user/user.module b/modules/user/user.module index a244ea887..b3bd9f860 100644 --- a/modules/user/user.module +++ b/modules/user/user.module @@ -679,10 +679,6 @@ function user_role_permissions($roles = array()) { */ function user_access($string, $account = NULL) { global $user; - // Use the advanced drupal_static() pattern, since this is called very often. - static $drupal_static = array(); - isset($drupal_static[__FUNCTION__]) || ($drupal_static[__FUNCTION__] = &drupal_static(__FUNCTION__)); - $perm = &$drupal_static[__FUNCTION__]; if (!isset($account)) { $account = $user; @@ -695,6 +691,10 @@ function user_access($string, $account = NULL) { // To reduce the number of SQL queries, we cache the user's permissions // in a static variable. + // Use the advanced drupal_static() pattern, since this is called very often. + static $drupal_static = array(); + isset($drupal_static[__FUNCTION__]) || ($drupal_static[__FUNCTION__] = &drupal_static(__FUNCTION__)); + $perm = &$drupal_static[__FUNCTION__]; if (!isset($perm[$account->uid])) { $role_permissions = user_role_permissions($account->roles); |