- Patch #1273206 by droplet: access global when it essentially needed.
parent
403850336c
commit
cf9b0d63ed
|
@ -2833,8 +2833,6 @@ function node_search_validate($form, &$form_state) {
|
||||||
* TRUE if the operation may be performed, FALSE otherwise.
|
* TRUE if the operation may be performed, FALSE otherwise.
|
||||||
*/
|
*/
|
||||||
function node_access($op, $node, $account = NULL) {
|
function node_access($op, $node, $account = NULL) {
|
||||||
global $user;
|
|
||||||
|
|
||||||
$rights = &drupal_static(__FUNCTION__, array());
|
$rights = &drupal_static(__FUNCTION__, array());
|
||||||
|
|
||||||
if (!$node || !in_array($op, array('view', 'update', 'delete', 'create'), TRUE)) {
|
if (!$node || !in_array($op, array('view', 'update', 'delete', 'create'), TRUE)) {
|
||||||
|
@ -2844,7 +2842,7 @@ function node_access($op, $node, $account = NULL) {
|
||||||
}
|
}
|
||||||
// If no user object is supplied, the access check is for the current user.
|
// If no user object is supplied, the access check is for the current user.
|
||||||
if (empty($account)) {
|
if (empty($account)) {
|
||||||
$account = $user;
|
$account = $GLOBALS['user'];
|
||||||
}
|
}
|
||||||
|
|
||||||
// $node may be either an object or a node type. Since node types cannot be
|
// $node may be either an object or a node type. Since node types cannot be
|
||||||
|
|
Loading…
Reference in New Issue