Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when EXDATE spans multiple lines #114

Closed
acmurmeltier69 opened this issue Mar 27, 2017 · 4 comments
Closed

Error when EXDATE spans multiple lines #114

acmurmeltier69 opened this issue Mar 27, 2017 · 4 comments

Comments

@acmurmeltier69
Copy link

acmurmeltier69 commented Mar 27, 2017

(I think this is not related to #113, so I created a separate issue)

If a set of excluded dates is added via EXDATE, the system returns the wrong dates after the initial week.

DTSTART;VALUE=DATE:20170313
RRULE:FREQ=WEEKLY;UNTIL=20171224T000000Z;INTERVAL=2;BYDAY=MO;WKST=SU
EXDATE;VALUE=DATE:
20170410,
20170605

It appears that the concatenation in ICal.php Line 379 adds the dates to the wrong line (i.e. the RRULE line above)

In contrast, if EXDATE is presented in a single row, the dates seem to be correct

DTSTART;VALUE=DATE:20170313
RRULE:FREQ=WEEKLY;UNTIL=20171224T000000Z;INTERVAL=2;BYDAY=MO;WKST=SU
EXDATE;VALUE=DATE:20170410,20170605

@u01jmg3
Copy link
Owner

u01jmg3 commented Mar 27, 2017

  • Problem surrounds this line where the parser blanks what it believes to be a key missing a value
    • (The parser can understand multiple lines containing dates for an EXDATE but the problem relates to a missing value directly after the key and its colon)
  • Debating what to do as each line of an iCal file should be a key/value pair per line, with subsequent values following

e.g. this will work

DTSTART;VALUE=DATE:20170313
RRULE:FREQ=WEEKLY;UNTIL=20171224T000000Z;INTERVAL=2;BYDAY=MO;WKST=SU
EXDATE;VALUE=DATE:20170410,
 20170605

@acmurmeltier69
Copy link
Author

acmurmeltier69 commented Mar 28, 2017

Hi

Unfortunately the iCAL spec RFC5545 allows more flexibility (See section 2 content lines)

A long line can be split between any two characters by inserting a CRLF immediately followed by a single linear white-space character

@acmurmeltier69
Copy link
Author

acmurmeltier69 commented Mar 28, 2017

This seems to do the job adding:

$lines = explode("\r\n", $this->unfold(implode("\r\n", $lines)));

after line 172

@u01jmg3
Copy link
Owner

u01jmg3 commented Mar 28, 2017

Got a fix coming

@u01jmg3 u01jmg3 added this to the v2.x.x milestone Mar 28, 2017
@u01jmg3 u01jmg3 changed the title Error when EXDATE spans over multiple lines Error when EXDATE spans multiple lines Mar 28, 2017
@u01jmg3 u01jmg3 removed their assignment Mar 29, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants