From a10b772516590b7b1b060b50babad1c3ee5c8fae Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Tue, 9 Mar 2021 08:56:14 +0200 Subject: [PATCH] fix PHP Notice: Undefined offset --- api/src/Categories.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/src/Categories.php b/api/src/Categories.php index ab9b962dd8..9cbbb46e24 100644 --- a/api/src/Categories.php +++ b/api/src/Categories.php @@ -557,8 +557,8 @@ class Categories $owner_grant = false; foreach(explode(',',$category['owner']) as $owner) { - $owner_grant = $owner_grant || (is_array($this->grants) && ($this->grants[$owner] & $needed) && - ($category['access'] == 'public' || ($this->grants[$owner] & Acl::PRIVAT))); + $owner_grant = $owner_grant || (is_array($this->grants) && !empty($this->grants[$owner]) && ($this->grants[$owner] & $needed) && + ($category['access'] === 'public' || ($this->grants[$owner] & Acl::PRIVAT))); } return $acl_grant && $owner_grant; }