aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Tanghus <thomas@tanghus.net>2012-06-11 12:55:01 +0200
committerThomas Tanghus <thomas@tanghus.net>2012-06-11 12:55:54 +0200
commit6d9947b3ff7cb3d6d67b538dc3e522fd1f8ccaa1 (patch)
treef9783a9613a80f27397895ed3ec9911dfdb86413
parent0df67aeae97747cc776acbbd479471979cfcb48b (diff)
downloadnextcloud-server-6d9947b3ff7cb3d6d67b538dc3e522fd1f8ccaa1.tar.gz
nextcloud-server-6d9947b3ff7cb3d6d67b538dc3e522fd1f8ccaa1.zip
Contacts: Fix NOTE also on add, not just save.
-rw-r--r--apps/contacts/ajax/addproperty.php13
1 files changed, 11 insertions, 2 deletions
diff --git a/apps/contacts/ajax/addproperty.php b/apps/contacts/ajax/addproperty.php
index 42b0c782035..94e09bac190 100644
--- a/apps/contacts/ajax/addproperty.php
+++ b/apps/contacts/ajax/addproperty.php
@@ -82,6 +82,7 @@ if(is_array($value)) {
$value = strip_tags($value);
}
+/* preprocessing value */
switch($name) {
case 'BDAY':
$date = New DateTime($value);
@@ -94,6 +95,8 @@ switch($name) {
case 'N':
case 'ORG':
case 'NOTE':
+ $value = str_replace('\n', ' \\n', $value);
+ break;
case 'NICKNAME':
// TODO: Escape commas and semicolons.
break;
@@ -105,8 +108,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;