diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2009-11-22 04:22:54 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2009-11-22 04:22:54 +0000 |
commit | 2fad47da011b041af32327da3c04758ee8bdd0a8 (patch) | |
tree | 4b8bfcb02cebd585393394d9cc4deae52a91b0ba | |
parent | 8d07e3b2943eede5eea0954e718d72437b8c461a (diff) | |
download | brdo-2fad47da011b041af32327da3c04758ee8bdd0a8.tar.gz brdo-2fad47da011b041af32327da3c04758ee8bdd0a8.tar.bz2 |
#619666 follow-up by effulgentsia: Fixed hunk in user_access().
-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); |