diff options
author | thomascube <thomas@roundcube.net> | 2008-09-04 18:20:27 +0000 |
---|---|---|
committer | thomascube <thomas@roundcube.net> | 2008-09-04 18:20:27 +0000 |
commit | 0dbac3218130dfe418d6c7dc162f819c746bec2d (patch) | |
tree | 12fe7f8ac96d3fcbff68d32f6e048374b474d9a2 /program/include | |
parent | d41f9762a7fa9e206a499bfa197435a578e36360 (diff) |
Enable export of contacts as vCard + DRY
Diffstat (limited to 'program/include')
-rw-r--r-- | program/include/rcube_shared.inc | 8 | ||||
-rw-r--r-- | program/include/rcube_vcard.php | 11 |
2 files changed, 14 insertions, 5 deletions
diff --git a/program/include/rcube_shared.inc b/program/include/rcube_shared.inc index 0dd661ec5..5008251ad 100644 --- a/program/include/rcube_shared.inc +++ b/program/include/rcube_shared.inc @@ -37,8 +37,14 @@ function send_nocacheing_headers() header("Expires: ".gmdate("D, d M Y H:i:s")." GMT"); header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT"); - header("Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0"); + header("Cache-Control: private, no-store, no-cache, must-revalidate, post-check=0, pre-check=0"); header("Pragma: no-cache"); + + // We need to set the following headers to make downloads work using IE in HTTPS mode. + if (isset($_SERVER['HTTPS'])) { + header('Pragma: '); + header('Cache-Control: '); + } } diff --git a/program/include/rcube_vcard.php b/program/include/rcube_vcard.php index 560d37d17..3ad47a5cb 100644 --- a/program/include/rcube_vcard.php +++ b/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"; } |