fix PHP 8.0 TypeError: array_keys(): Argument #1 ($array) must be of type array, null given

This commit is contained in:
Ralf Becker 2021-11-19 13:00:51 +01:00
parent 83cb6acca7
commit 916565f797

View File

@ -513,7 +513,7 @@ class Sql extends Api\Storage
$shared_sql = $this->table_name.'.contact_id IN (SELECT contact_id FROM '.self::SHARED_TABLE.' WHERE '. $shared_sql = $this->table_name.'.contact_id IN (SELECT contact_id FROM '.self::SHARED_TABLE.' WHERE '.
// $filter[tid] === null is used by sync-collection report, in which case we need to return deleted shares, to remove them from devices // $filter[tid] === null is used by sync-collection report, in which case we need to return deleted shares, to remove them from devices
(array_key_exists('tid', $filter) && !isset($filter['tid']) ? '' : 'shared_deleted IS NULL AND '). (array_key_exists('tid', $filter) && !isset($filter['tid']) ? '' : 'shared_deleted IS NULL AND ').
$this->db->expression(self::SHARED_TABLE, ['shared_with' => $filter['owner'] ?? array_keys($this->grants)]).')'; $this->db->expression(self::SHARED_TABLE, ['shared_with' => $filter['owner'] ?? array_keys($this->grants ?? [0])]).')';
} }
// add filter for read ACL in sql, if user is NOT the owner of the addressbook // add filter for read ACL in sql, if user is NOT the owner of the addressbook