diff options
| author | thomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2008-09-04 18:20:27 +0000 |
|---|---|---|
| committer | thomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2008-09-04 18:20:27 +0000 |
| commit | 46de7563c2bf659895ae1c6680e73dba49e2158c (patch) | |
| tree | efefc61a4d92ca127cd228196444d50df058c17d /roundcubemail/program/include/rcube_vcard.php | |
| parent | c371f5c8d312284a8722aed04119b7f50c4928d5 (diff) | |
Enable export of contacts as vCard + DRY
git-svn-id: https://svn.roundcube.net/trunk@1732 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/include/rcube_vcard.php')
| -rw-r--r-- | roundcubemail/program/include/rcube_vcard.php | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/roundcubemail/program/include/rcube_vcard.php b/roundcubemail/program/include/rcube_vcard.php index 560d37d17..3ad47a5cb 100644 --- a/roundcubemail/program/include/rcube_vcard.php +++ b/roundcubemail/program/include/rcube_vcard.php @@ -28,7 +28,10 @@ */ class rcube_vcard { - private $raw = array(); + private $raw = array( + 'FN' => array(), + 'N' => array(array('','','','','')), + ); public $business = false; public $displayname; @@ -98,7 +101,7 @@ class rcube_vcard * @param string Field value * @param string Section name */ - public function set($field, $value, $section = 'home') + public function set($field, $value, $section = 'HOME') { switch ($field) { case 'name': @@ -222,7 +225,7 @@ class rcube_vcard private static function rfc2425_fold($val) { - return preg_replace('/:([^\n]{72,})/e', '":\n ".rtrim(chunk_split("\\1", 72, "\n "))', $val) . "\n\n"; + return preg_replace('/:([^\n]{72,})/e', '":\n ".rtrim(chunk_split("\\1", 72, "\n "))', $val) . "\n"; } @@ -325,7 +328,7 @@ class rcube_vcard } } - return "BEGIN:VCARD\nVERSION:3.0\n{$vcard}END:VCARD\n"; + return "BEGIN:VCARD\nVERSION:3.0\n{$vcard}END:VCARD"; } |
