summaryrefslogtreecommitdiff
path: root/program/include
diff options
context:
space:
mode:
authorthomascube <thomas@roundcube.net>2011-05-18 10:15:12 +0000
committerthomascube <thomas@roundcube.net>2011-05-18 10:15:12 +0000
commit4e3ec4eca8b1bb1f4e3810125b920f696711d7a6 (patch)
tree3ac75fe81570198e6c7be4fc40b66a91dbb52d1b /program/include
parent392589ef38ab677782ce9b76a1b1ba2a02cae023 (diff)
Fix vcard value decoding; add setter for individual vcard fields
Diffstat (limited to 'program/include')
-rw-r--r--program/include/rcube_vcard.php15
1 files changed, 14 insertions, 1 deletions
diff --git a/program/include/rcube_vcard.php b/program/include/rcube_vcard.php
index 40ec353e5..a8474647d 100644
--- a/program/include/rcube_vcard.php
+++ b/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", '\,' => ',', '\;' => ';', '\:' => ':'));
}
}