1
0
mirror of https://github.com/owncloudarchive/contacts.git synced 2024-11-29 11:24:11 +01:00

Merge pull request #999 from gvde/fix-n-prop-handling

make sure N property is set as multi-valued...
This commit is contained in:
LEDfan 2015-09-09 16:12:51 +02:00
commit 00297c9ca6

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: