dev/core#3160 fix inability to import 'just contactid' and add to group
[civicrm-core.git] / CRM / Utils / ICalendar.php
index 6f71bf8b6d60320af6443a3986aa4cc61d8b56a8..7eee09c9ebc777a001860a5c3061e281c6aece5a 100644 (file)
@@ -61,7 +61,7 @@ class CRM_Utils_ICalendar {
   /**
    * Escape date elements for safe ICalendar use.
    *
-   * @param $date
+   * @param string $date
    *   Date to escape.
    *
    * @param bool $gdata
@@ -85,8 +85,7 @@ class CRM_Utils_ICalendar {
 
   /**
    * Send the ICalendar to the browser with the specified content type
-   * - 'text/calendar' : used for downloaded ics file
-   * - 'text/plain'    : used for iCal formatted feed
+   * - 'text/calendar' : used for iCal formatted feed
    * - 'text/xml'      : used for gData or rss formatted feeds
    *
    *
@@ -106,7 +105,7 @@ class CRM_Utils_ICalendar {
     CRM_Utils_System::setHttpHeader("Content-Language", $lang);
     CRM_Utils_System::setHttpHeader("Content-Type", "$content_type; charset=$charset");
 
-    if ($content_type == 'text/calendar') {
+    if ($fileName) {
       CRM_Utils_System::setHttpHeader('Content-Length', strlen($calendar));
       CRM_Utils_System::setHttpHeader("Content-Disposition", "$disposition; filename=\"$fileName\"");
       CRM_Utils_System::setHttpHeader("Pragma", "no-cache");