When parsing multiple iCalendar files, at least one of which contains a
VEVENT with a RECURRENCE-ID, iCal::Parser crashes (on line 297 of
Parser.pm, $d is undefined).
The problem is that parse() calls update_recurrences() on line 57 once
for each file, but update_recurrences() deletes the RECURRENCE-ID
property on line 311 during the first pass.
The patch I have attached fixes this bug.
Subject: | iCal-Parser-1.14-recurrence.patch |
--- iCal-Parser-1.14/lib/iCal/Parser.pm.recurrence 2006-10-19 15:21:55.000000000 -0700
+++ iCal-Parser-1.14/lib/iCal/Parser.pm 2007-03-07 01:25:45.979876636 -0800
@@ -308,14 +308,15 @@
sub update_recurrences {
my $self=shift;
foreach my $event (@{ $self->{recurrences} }) {
my $day=$self->find_day(delete $event->{'RECURRENCE-ID'});
my $old=delete $day->{$event->{UID}}||{};
$self->add_event({%$old,%$event});
}
+ delete $self->{recurrences};
}
sub add_span {
my($self,$event)=@_;
my %last=%$event;
#when event spans days, only alarm on first entry
delete $last{VALARM};