From 6218cfb6b1b6ee5fd17ef64e6986b9dda575de95 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Fri, 5 Nov 2021 14:43:32 +0100 Subject: [PATCH] fix PHP 8.0 TypeError: explode(): Argument #2 ($string) must be of type string, array given --- addressbook/inc/class.addressbook_groupdav.inc.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/addressbook/inc/class.addressbook_groupdav.inc.php b/addressbook/inc/class.addressbook_groupdav.inc.php index 95a7d5ad86..4114bf9a5e 100644 --- a/addressbook/inc/class.addressbook_groupdav.inc.php +++ b/addressbook/inc/class.addressbook_groupdav.inc.php @@ -98,8 +98,11 @@ class addressbook_groupdav extends Api\CalDAV\Handler } if ($this->debug) error_log(__METHOD__."() contact_repository={$this->bo->contact_repository}, account_repository={$this->bo->account_repository}, REQUEST_URI=$_SERVER[REQUEST_URI] --> path_attr=".self::$path_attr.", path_extension=".self::$path_extension); - $this->home_set_pref = $GLOBALS['egw_info']['user']['preferences']['groupdav']['addressbook-home-set']; - $this->home_set_pref = $this->home_set_pref ? explode(',',$this->home_set_pref) : array(); + $this->home_set_pref = $GLOBALS['egw_info']['user']['preferences']['groupdav']['addressbook-home-set'] ?? []; + if (!is_array($this->home_set_pref)) + { + $this->home_set_pref = $this->home_set_pref ? explode(',', $this->home_set_pref) : array(); + } // silently switch "Sync all into one" preference on for OS X addressbook, as it only supports one AB // this restores behavior before Lion (10.7), where AB synced all ABs contained in addressbook-home-set