From 40f08d9a89821986c1437e944b3b152dc9564fab Mon Sep 17 00:00:00 2001 From: Doug Bell Date: Wed, 6 Dec 2006 23:29:02 +0000 Subject: [PATCH] Fixed another iCal bug in Calendar... I'm not feeling the confidence I once felt... --- lib/WebGUI/Asset/Wobject/Calendar.pm | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/lib/WebGUI/Asset/Wobject/Calendar.pm b/lib/WebGUI/Asset/Wobject/Calendar.pm index d56d2381d..3b9dd8acf 100644 --- a/lib/WebGUI/Asset/Wobject/Calendar.pm +++ b/lib/WebGUI/Asset/Wobject/Calendar.pm @@ -1341,6 +1341,8 @@ sub wrapIcal my $self = shift; my $text = shift; + return $text unless length $text >= 75; + $text =~ s/([,;\\])/\\$1/g; $text =~ s/\n/\\n/g; @@ -1477,14 +1479,14 @@ sub www_ical my @events = $self->getEventsIn($dt_start->toMysql,$dt_end->toMysql); - my $ical = qq{BEGIN:VCALENDAR\n} - . qq{PRODID:WebGUI \n} # TODO: Get WebGUI version! - . qq{VERSION:2.0\n}; + my $ical = qq{BEGIN:VCALENDAR\r\n} + . qq{PRODID:WebGUI \r\n} # TODO: Get WebGUI version! + . qq{VERSION:2.0\r\n}; # VEVENT: for my $event (@events) { - $ical .= qq{BEGIN:VEVENT\n}; + $ical .= qq{BEGIN:VEVENT\r\n}; # Currently we only need # UID @@ -1524,11 +1526,11 @@ sub www_ical $ical .= "X-WEBGUI-URL:".$event->get("url")."\r\n"; - $ical .= qq{END:VEVENT\n}; + $ical .= qq{END:VEVENT\r\n}; } # ENDVEVENT - $ical .= qq{END:VCALENDAR\n}; + $ical .= qq{END:VCALENDAR\r\n}; # Set mime of text/icalendar