diff --git a/addressbook/inc/class.addressbook_vcal.inc.php b/addressbook/inc/class.addressbook_vcal.inc.php index 812466a1f4..f3c8013288 100644 --- a/addressbook/inc/class.addressbook_vcal.inc.php +++ b/addressbook/inc/class.addressbook_vcal.inc.php @@ -971,11 +971,12 @@ class addressbook_vcal extends addressbook_bo { if (!empty($fieldName)) { - $value = trim($vcardValues[$vcardKey]['values'][$fieldKey]); + $value = $vcardValues[$vcardKey]['values'][$fieldKey]; + if (is_string($value)) $value = trim($value); if ($pref_tel && (($vcardKey == $pref_tel) || - ($vcardValues[$vcardKey]['name'] == 'TEL') && - ($vcardValues[$vcardKey]['value'] == $vcardValues[$pref_tel]['value']))) + ($vcardValues[$vcardKey]['name'] == 'TEL') && + ($vcardValues[$vcardKey]['value'] == $vcardValues[$pref_tel]['value']))) { $contact['tel_prefer'] = $fieldName; }