1
0
mirror of https://github.com/owncloudarchive/contacts.git synced 2025-01-30 19:52:17 +01:00

make sure N property is set as multi-valued...

This commit is contained in:
Gerald Vogt 2015-07-21 11:18:40 +02:00
parent c189194aa8
commit 8ae8d4c897

View File

@ -579,14 +579,23 @@ class Contact extends VObject\VCard implements IPIMObject {
if (count($property) === 0) {
$property = $this->createProperty($name);
$this->add($property);
} elseif (count($property) > 1) {
\OCP\Util::writeLog('contacts',
__METHOD__.' more than one property for ' . $name,
\OCP\Util::ERROR
);
return false;
} else {
// Actually no idea why this works
// select returns an array...
$property = array_shift($property);
}
if (($name === 'N') && !is_array($value)) {
$value = explode(';', (string)$value);
}
if (is_array($value)) {
$property->setParts($value);
} else {
$this->{$name} = $value;
$property->setValue($value);
}
break;
default: