From d9625f77ef31afbf34bff063ae81c027d17bc06d Mon Sep 17 00:00:00 2001 From: Lukas Reschke Date: Mon, 11 Jun 2012 19:07:51 +0200 Subject: [PATCH] Make some apps compatible --- ajax/addproperty.php | 13 +++++++++++-- templates/part.contacts.php | 2 +- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/ajax/addproperty.php b/ajax/addproperty.php index 42b0c782..94e09bac 100644 --- a/ajax/addproperty.php +++ b/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; diff --git a/templates/part.contacts.php b/templates/part.contacts.php index 57517505..00a61f72 100644 --- a/templates/part.contacts.php +++ b/templates/part.contacts.php @@ -8,5 +8,5 @@ } } ?> -
  • +