diff --git a/api/src/Categories.php b/api/src/Categories.php index da6c22fb99..ab9b962dd8 100644 --- a/api/src/Categories.php +++ b/api/src/Categories.php @@ -557,7 +557,7 @@ class Categories $owner_grant = false; foreach(explode(',',$category['owner']) as $owner) { - $owner_grant = $owner_grant || (($this->grants[$owner] & $needed) && + $owner_grant = $owner_grant || (is_array($this->grants) && ($this->grants[$owner] & $needed) && ($category['access'] == 'public' || ($this->grants[$owner] & Acl::PRIVAT))); } return $acl_grant && $owner_grant; diff --git a/api/src/Contacts.php b/api/src/Contacts.php index c568916d9a..581dccd2f5 100755 --- a/api/src/Contacts.php +++ b/api/src/Contacts.php @@ -1271,7 +1271,7 @@ class Contacts extends Contacts\Storage $shared['shared_writable'] && $this->check_perms($needed, $contact, $deny_account_delete, $shared['shared_by'], $check_shared-1))) { $access = "shared"; - error_log(__METHOD__."($needed,$contact[id],$deny_account_delete,$user,$check_shared) shared=".json_encode($shared)." returning ".array2string($access)); + //error_log(__METHOD__."($needed,$contact[id],$deny_account_delete,$user,$check_shared) shared=".json_encode($shared)." returning ".array2string($access)); break; } } diff --git a/api/src/Storage/Merge.php b/api/src/Storage/Merge.php index 650b45a779..db00079faf 100644 --- a/api/src/Storage/Merge.php +++ b/api/src/Storage/Merge.php @@ -292,7 +292,7 @@ abstract class Merge foreach($ignore_acl ? Customfields::get('addressbook', true) : $this->contacts->customfields as $name => $field) { $name = '#'.$name; - if(!$contact[$name]) + if(!array_key_exists($name, $contact) || !$contact[$name]) { $replacements['$$'.($prefix ? $prefix.'/':'').$name.'$$'] = ''; continue;