summaryrefslogtreecommitdiff
path: root/roundcubemail/program
diff options
context:
space:
mode:
authorthomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c>2011-05-18 10:15:12 +0000
committerthomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c>2011-05-18 10:15:12 +0000
commitf0be131150d901d4c07aa7a103eeddb7b109fb8c (patch)
treed889fa32428e7cbcf8d86e32b6d9f362ab05621e /roundcubemail/program
parent3fb463e512cc72c8107e3482d225778e074a31a8 (diff)
Fix vcard value decoding; add setter for individual vcard fields
git-svn-id: https://svn.roundcube.net/trunk@4781 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program')
-rw-r--r--roundcubemail/program/include/rcube_vcard.php15
1 files changed, 14 insertions, 1 deletions
diff --git a/roundcubemail/program/include/rcube_vcard.php b/roundcubemail/program/include/rcube_vcard.php
index 40ec353e5..a8474647d 100644
--- a/roundcubemail/program/include/rcube_vcard.php
+++ b/roundcubemail/program/include/rcube_vcard.php
@@ -331,6 +331,19 @@ class rcube_vcard
}
}
+ /**
+ * Setter for individual vcard properties
+ *
+ * @param string VCard tag name
+ * @param array Value-set of this vcard property
+ * @param boolean Set to true if the value-set should be appended instead of replacing any existing value-set
+ */
+ public function set_raw($tag, $value, $append = false)
+ {
+ $index = $append ? count($this->raw[$tag]) : 0;
+ $this->raw[$tag][$index] = (array)$value;
+ }
+
/**
* Find index with the '$type' attribute
@@ -651,7 +664,7 @@ class rcube_vcard
return $result;
}
else {
- return strtr($s, array("\r" => '', '\\\\' => '\\', '\n' => "\n", '\N' => "\n", '\,' => ',', '\;' => ';'));
+ return strtr($s, array("\r" => '', '\\\\' => '\\', '\n' => "\n", '\N' => "\n", '\,' => ',', '\;' => ';', '\:' => ':'));
}
}