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

Crash on invalid calendar start date #123

Closed
acmurmeltier69 opened this issue Apr 6, 2017 · 1 comment
Closed

Crash on invalid calendar start date #123

acmurmeltier69 opened this issue Apr 6, 2017 · 1 comment

Comments

@acmurmeltier69
Copy link

acmurmeltier69 commented Apr 6, 2017

Hello

(another issue, sorry!)
One of my users observed a crash with a calendar file he downloaded from his citie's webpage.

It turned out that the file contained an invalid date

BEGIN:VEVENT
DTSTART:2017103**2**T000000
DTEND:20171101T2300
SUMMARY:Biotonne
DESCRIPTION:Biotonne muss bereitgestellt werden.
DTSTAMP:20170406T063924
LOCATION:Vechelde a
UID:f81b0b41a2e138ae0903daee0a966e1e
SEQUENCE:0
END:VEVENT

Obviously this is wrong.
However, is there a way to ignore such a situation more gracefully?

At the moment I get

Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (20171032T000000) at position 7 (2): Unexpected character' in ICal\ICal.php:575 Stack trace: #0 ICal\ICal.php(575): DateTime->__construct('20171032T000000', Object(DateTimeZone)) #1 ICal\ICal.php(1355): ICal\ICal->iCalDateWithTimeZone(Array, 'DTSTART', true) #2 ICal\ICal.php(322): ICal\ICal->processDateConversions() #3 ICal\ICal.php(185): ICal\ICal->initLines(Array) #4 

or should I just put a
try {} catch {} around the constructor?

@u01jmg3 u01jmg3 self-assigned this Apr 6, 2017
@acmurmeltier69
Copy link
Author

acmurmeltier69 commented Apr 6, 2017

Thanks.
I managed to safely catch the exception in my app.
So it is not blocking me. (Still worth investigating, however)

@u01jmg3 u01jmg3 closed this as completed in 33bf92f Apr 6, 2017
@u01jmg3 u01jmg3 removed their assignment Apr 6, 2017
@u01jmg3 u01jmg3 added this to the v2.x.x milestone Apr 6, 2017
@u01jmg3 u01jmg3 changed the title crash on invalid calendar date Crash on invalid calendar date Apr 6, 2017
@u01jmg3 u01jmg3 changed the title Crash on invalid calendar date Crash on invalid calendar start date Apr 6, 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