]> source.dussan.org Git - nextcloud-server.git/commitdiff
Contacts: Fix NOTE also on add, not just save.
authorThomas Tanghus <thomas@tanghus.net>
Mon, 11 Jun 2012 10:55:01 +0000 (12:55 +0200)
committerThomas Tanghus <thomas@tanghus.net>
Mon, 11 Jun 2012 10:56:41 +0000 (12:56 +0200)
apps/contacts/ajax/addproperty.php

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