* CardDAV: SoGo and Busycontacts without all name- or organisation components use last value for missing ones

eg. "N:Lastname;Firstname" would also set middle-name, prefix and sufix with "Firstname", same with "ORG:Organisation" would set department and position with "Organisation"
This commit is contained in:
Ralf Becker 2016-04-27 14:46:44 +00:00
parent dbb998de96
commit a5080a29d5

View File

@ -928,11 +928,9 @@ class addressbook_vcal extends addressbook_bo
foreach ($fieldNames as $fieldKey => $fieldName) foreach ($fieldNames as $fieldKey => $fieldName)
{ {
if (!empty($fieldName)) if (!empty($fieldName))
{
if (is_scalar($vcardValues[$vcardKey]['values'][$fieldKey]))
{ {
$value = trim($vcardValues[$vcardKey]['values'][$fieldKey]); $value = trim($vcardValues[$vcardKey]['values'][$fieldKey]);
}
if ($pref_tel && (($vcardKey == $pref_tel) || if ($pref_tel && (($vcardKey == $pref_tel) ||
($vcardValues[$vcardKey]['name'] == 'TEL') && ($vcardValues[$vcardKey]['name'] == 'TEL') &&
($vcardValues[$vcardKey]['value'] == $vcardValues[$pref_tel]['value']))) ($vcardValues[$vcardKey]['value'] == $vcardValues[$pref_tel]['value'])))