From 06209ca559b2ed3d50a63eb477b29c253a795bc4 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Mon, 10 Apr 2023 12:51:43 +0200 Subject: [PATCH] Fix PHP warnings --- .../drivers/carddav/carddav_contacts.php | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/plugins/kolab_addressbook/drivers/carddav/carddav_contacts.php b/plugins/kolab_addressbook/drivers/carddav/carddav_contacts.php index bbffb6ef..da8dc270 100644 --- a/plugins/kolab_addressbook/drivers/carddav/carddav_contacts.php +++ b/plugins/kolab_addressbook/drivers/carddav/carddav_contacts.php @@ -524,7 +524,7 @@ class carddav_contacts extends rcube_addressbook $this->_fetch_groups(); $count = count($this->distlists[$this->gid]['member']); } - else if (is_array($this->filter['ids'])) { + else if (isset($this->filter['ids']) && is_array($this->filter['ids'])) { $count = count($this->filter['ids']); } else { @@ -728,14 +728,17 @@ class carddav_contacts extends rcube_addressbook } else { // remove from distribution lists - foreach ((array) $this->groupmembers[$id] as $gid) { - if (!$is_mailto || $gid == $this->gid) { - $this->remove_from_group($gid, $id); + if (isset($this->groupmembers[$id])) { + foreach ((array) $this->groupmembers[$id] as $gid) { + if (!$is_mailto || $gid == $this->gid) { + $this->remove_from_group($gid, $id); + } } + + // clear internal cache + unset($this->groupmembers[$id]); } - // clear internal cache - unset($this->groupmembers[$id]); $count++; } }