Issue #1273206 by droplet: Access global when it essentially needed.

merge-requests/26/head
webchick 2011-10-02 11:04:56 -07:00
parent f3268d135d
commit fa5a4a74c8
1 changed files with 1 additions and 3 deletions

View File

@ -2828,8 +2828,6 @@ function node_search_validate($form, &$form_state) {
* TRUE if the operation may be performed, FALSE otherwise.
*/
function node_access($op, $node, $account = NULL) {
global $user;
$rights = &drupal_static(__FUNCTION__, array());
if (!$node || !in_array($op, array('view', 'update', 'delete', 'create'), TRUE)) {
@ -2839,7 +2837,7 @@ function node_access($op, $node, $account = NULL) {
}
// If no user object is supplied, the access check is for the current user.
if (empty($account)) {
$account = $user;
$account = $GLOBALS['user'];
}
// $node may be either an object or a node type. Since node types cannot be