wjase / ics-parser

Automatically exported from code.google.com/p/ics-parser
0 stars 0 forks source link

Continuation lines with ':' parsed as new key-value field #6

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Parse an ICS file with the following multi-line value:
...
DESCRIPTION:BendTech Meetup\nWednesday\, April 17 at 6:00 PM\n\nThis meet
 ing is a followup to the INW meeting last Tuesday where we talked about
 MakerSpaces. We had a great turnout (30+ people) and lots of energy a...
 \n\nDetails: http://www.meetup.com/bendtech/events/114014962/
...

Notice that the last line is parsed as a separate key-value line, rather than 
as a continuation of the DESCRIPTION line.

This can be fixed by adding the following to the head of the foreach block in 
__construct():

                if (substr($line, 0, 1) == ' ') {
                  // continuation line
                  $line = substr($line, 1);
                  $this->addCalendarComponentWithKeyAndValue($type, false, $line);
                  continue;
                }

Original issue reported on code.google.com by broofa on 15 Apr 2013 at 12:42