Contacts: Fix NOTE also on add, not just save.

This commit is contained in:
Thomas Tanghus 2012-06-11 12:55:01 +02:00
parent c110308c1e
commit 74eece2620
1 changed files with 11 additions and 2 deletions

View File

@ -85,6 +85,7 @@ if(is_array($value)) {
$value = strip_tags($value); $value = strip_tags($value);
} }
/* preprocessing value */
switch($name) { switch($name) {
case 'BDAY': case 'BDAY':
$date = New DateTime($value); $date = New DateTime($value);
@ -97,6 +98,8 @@ switch($name) {
case 'N': case 'N':
case 'ORG': case 'ORG':
case 'NOTE': case 'NOTE':
$value = str_replace('\n', ' \\n', $value);
break;
case 'NICKNAME': case 'NICKNAME':
// TODO: Escape commas and semicolons. // TODO: Escape commas and semicolons.
break; break;
@ -108,8 +111,14 @@ switch($name) {
break; break;
} }
switch($name) {
$property = $vcard->addProperty($name, $value); //, $parameters); case 'NOTE':
$vcard->setString('NOTE', $value);
break;
default:
$property = $vcard->addProperty($name, $value); //, $parameters);
break;
}
$line = count($vcard->children) - 1; $line = count($vcard->children) - 1;