diff --git a/addressbook/inc/class.addressbook_groupdav.inc.php b/addressbook/inc/class.addressbook_groupdav.inc.php index d32b06965e..8f4eee0d32 100644 --- a/addressbook/inc/class.addressbook_groupdav.inc.php +++ b/addressbook/inc/class.addressbook_groupdav.inc.php @@ -672,6 +672,8 @@ class addressbook_groupdav extends groupdav_handler if ($this->debug) error_log(__METHOD__."(,$id) save(".array2string($contact).") failed, Ok=$save_ok"); if ($save_ok === 0) { + // honor Prefer: return=representation for 412 too (no need for client to explicitly reload) + $this->check_return_representation($options, $id, $user); return '412 Precondition Failed'; } return '403 Forbidden'; // happens when writing new entries in AB's without ADD rights diff --git a/addressbook/inc/class.addressbook_vcal.inc.php b/addressbook/inc/class.addressbook_vcal.inc.php index 4e31a44268..8d03d3ec35 100644 --- a/addressbook/inc/class.addressbook_vcal.inc.php +++ b/addressbook/inc/class.addressbook_vcal.inc.php @@ -929,7 +929,10 @@ class addressbook_vcal extends addressbook_bo { if (!empty($fieldName)) { - $value = trim($vcardValues[$vcardKey]['values'][$fieldKey]); + if (is_scalar($vcardValues[$vcardKey]['values'][$fieldKey])) + { + $value = trim($vcardValues[$vcardKey]['values'][$fieldKey]); + } if ($pref_tel && (($vcardKey == $pref_tel) || ($vcardValues[$vcardKey]['name'] == 'TEL') && ($vcardValues[$vcardKey]['value'] == $vcardValues[$pref_tel]['value']))) @@ -939,9 +942,9 @@ class addressbook_vcal extends addressbook_bo switch($fieldName) { case 'bday': - $contact[$fieldName] = $vcardValues[$vcardKey]['values']['year'] . - '-' . $vcardValues[$vcardKey]['values']['month'] . - '-' . $vcardValues[$vcardKey]['values']['mday']; + $contact[$fieldName] = $vcardValues[$vcardKey]['value']['year'] . + '-' . $vcardValues[$vcardKey]['value']['month'] . + '-' . $vcardValues[$vcardKey]['value']['mday']; break; case 'private':