Commit f69437de authored by Steven Wittens's avatar Steven Wittens

#12363: Bug in user_access() with uid 1 and $account parameter.

parent 29b32eff
......@@ -307,15 +307,15 @@ function user_access($string, $account = NULL) {
global $user;
static $perm = array();
if (is_null($account)) {
$account = $user;
}
// User #1 has all privileges:
if ($user->uid == 1) {
return 1;
}
if (is_null($account)) {
$account = $user;
}
// To reduce the number of SQL queries, we cache the user's permissions
// in a static variable.
if (!isset($perm[$account->uid])) {
......
......@@ -307,15 +307,15 @@ function user_access($string, $account = NULL) {
global $user;
static $perm = array();
if (is_null($account)) {
$account = $user;
}
// User #1 has all privileges:
if ($user->uid == 1) {
return 1;
}
if (is_null($account)) {
$account = $user;
}
// To reduce the number of SQL queries, we cache the user's permissions
// in a static variable.
if (!isset($perm[$account->uid])) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment