Removing changes for CRM-17033
[civicrm-core.git] / CRM / Utils / ICalendar.php
index d5107e8450caf2d6e60327350dfe78ce9ecd19b2..ea56475451ab0c9e6560a3daded8591911ec00e8 100644 (file)
@@ -1,9 +1,9 @@
 <?php
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.6                                                |
+ | CiviCRM version 4.7                                                |
  +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2014                                |
+ | Copyright CiviCRM LLC (c) 2004-2015                                |
  +--------------------------------------------------------------------+
  | This file is a part of CiviCRM.                                    |
  |                                                                    |
  | GNU Affero General Public License or the licensing of CiviCRM,     |
  | see the CiviCRM license FAQ at http://civicrm.org/licensing        |
  +--------------------------------------------------------------------+
-*/
+ */
 
 /**
  *
  * @package CRM
- * @copyright CiviCRM LLC (c) 2004-2014
+ * @copyright CiviCRM LLC (c) 2004-2015
  * $Id$
  *
  */
@@ -43,7 +43,7 @@
 class CRM_Utils_ICalendar {
 
   /**
-   * Escape text elements for safe ICalendar use
+   * Escape text elements for safe ICalendar use.
    *
    * @param $text
    *   Text to escape.
@@ -63,7 +63,7 @@ class CRM_Utils_ICalendar {
   }
 
   /**
-   * Escape date elements for safe ICalendar use
+   * Escape date elements for safe ICalendar use.
    *
    * @param $date
    *   Date to escape.
@@ -109,16 +109,15 @@ class CRM_Utils_ICalendar {
   public static function send($calendar, $content_type = 'text/calendar', $charset = 'us-ascii', $fileName = NULL, $disposition = NULL) {
     $config = CRM_Core_Config::singleton();
     $lang = $config->lcMessages;
-    header("Content-Language: $lang");
-    // header( "Content-Type: $content_type; charset=$charset; profile=\"ICalendar\"" );
-    header("Content-Type: $content_type; charset=$charset");
+    CRM_Utils_System::setHttpHeader("Content-Language", $lang);
+    CRM_Utils_System::setHttpHeader("Content-Type", "$content_type; charset=$charset");
 
     if ($content_type == 'text/calendar') {
-      header('Content-Length: ' . strlen($calendar));
-      header("Content-Disposition: $disposition; filename=\"$fileName\"");
-      header("Pragma: no-cache");
-      header("Expires: 0");
-      header("Cache-Control: no-cache, must-revalidate");
+      CRM_Utils_System::setHttpHeader('Content-Length', strlen($calendar));
+      CRM_Utils_System::setHttpHeader("Content-Disposition", "$disposition; filename=\"$fileName\"");
+      CRM_Utils_System::setHttpHeader("Pragma", "no-cache");
+      CRM_Utils_System::setHttpHeader("Expires", "0");
+      CRM_Utils_System::setHttpHeader("Cache-Control", "no-cache, must-revalidate");
     }
 
     echo $calendar;