fix PHP Notice: Undefined offset

This commit is contained in:
Ralf Becker 2021-03-09 08:56:14 +02:00
parent 9baa79de5e
commit a10b772516

View File

@ -557,8 +557,8 @@ class Categories
$owner_grant = false; $owner_grant = false;
foreach(explode(',',$category['owner']) as $owner) foreach(explode(',',$category['owner']) as $owner)
{ {
$owner_grant = $owner_grant || (is_array($this->grants) && ($this->grants[$owner] & $needed) && $owner_grant = $owner_grant || (is_array($this->grants) && !empty($this->grants[$owner]) && ($this->grants[$owner] & $needed) &&
($category['access'] == 'public' || ($this->grants[$owner] & Acl::PRIVAT))); ($category['access'] === 'public' || ($this->grants[$owner] & Acl::PRIVAT)));
} }
return $acl_grant && $owner_grant; return $acl_grant && $owner_grant;
} }