diff -ur calendar.orig/calendar_ical/calendar-view-ical.tpl.php calendar/calendar_ical/calendar-view-ical.tpl.php --- calendar.orig/calendar_ical/calendar-view-ical.tpl.php 2008-10-10 16:59:03.000000000 -0400 +++ calendar/calendar_ical/calendar-view-ical.tpl.php 2009-12-26 14:12:18.000000000 -0500 @@ -33,13 +33,13 @@ BEGIN:VEVENT UID: SUMMARY: -DTSTAMP;TZID=;VALUE=DATE-TIME: +DTSTAMP: DTSTART;VALUE=DATE-TIME: DTEND;VALUE=DATE-TIME: -RRULE; + URL;VALUE=URI: diff -ur calendar.orig/calendar_ical/theme.inc calendar/calendar_ical/theme.inc --- calendar.orig/calendar_ical/theme.inc 2009-02-27 09:10:35.000000000 -0500 +++ calendar/calendar_ical/theme.inc 2009-12-26 16:24:58.000000000 -0500 @@ -3,6 +3,13 @@ /** * Preprocess an ical feed */ + +function sanitize_for_ical($input) { + $output = preg_replace('/[\n\r]/', ' ', $input); + $output = wordwrap($output, 60, "\r\n "); + return $output; + } + function template_preprocess_calendar_view_ical(&$vars) { global $base_url; global $language; @@ -59,8 +66,8 @@ $event['summary'] = strip_tags($node->$summary_field); $event['start'] = $node->calendar_start_date; $event['end'] = $node->calendar_end_date; - $event['description'] = !empty($description_field) && !empty($node->$description_field) ? $node->$description_field : ''; - $event['location'] = !empty($location_field) && !empty($node->$location_field) ? $node->$location_field : ''; + $event['description'] = !empty($description_field) && !empty($node->$description_field) ? sanitize_for_ical($node->$description_field) : ''; + $event['location'] = !empty($location_field) && !empty($node->$location_field) ? sanitize_for_ical($node->$location_field) : ''; $event['url'] = !empty($node->url) ? $node->url : (is_numeric($node->nid) ? url("node/$node->nid", array('absolute' => TRUE)) : $node->nid); $event['uid'] = !empty($node->date_id) ? $node->date_id : $event['url']; $event['rrule'] = !empty($rrule_field) && !empty($node->$rrule_field) ? $node->$rrule_field : '';