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

Parse failure on dates before 1970 with an inline timezone #159

Closed
ruskiyos opened this issue Aug 29, 2017 · 0 comments
Closed

Parse failure on dates before 1970 with an inline timezone #159

ruskiyos opened this issue Aug 29, 2017 · 0 comments

Comments

@ruskiyos
Copy link

ruskiyos commented Aug 29, 2017

invalid_date.txt

  • PHP Version: 7.1.8
  • PHP date.timezone: America/Los_Angeles
  • ICS Parser Version: dev-master
  • Linux

Description of the Issue:

When parsing an event with a inline timezone, earlier than 1970, the parser fails.
DTSTART;TZID=America/Los_Angeles:00011212T020000

Steps to Reproduce:

Parse attached file.
Error returned: The timezone could not be found in the database

Notes

File: ICal.php
Line: 661

if less than year, parse raw string, even though it should continue on to next if statement

// A Unix timestamp cannot represent a date prior to 1 Jan 1970
$year = $date[2];
if ($year <= self::UNIX_MIN_YEAR) {
    $dateTime = new \DateTime($icalDate, new \DateTimeZone($this->defaultTimeZone));
} else {
    if ($forceTimeZone) {
...
@u01jmg3 u01jmg3 self-assigned this Aug 29, 2017
@u01jmg3 u01jmg3 changed the title Parse failure on dates before 1970 with inline timezone Parse failure on dates before 1970 with an inline timezone Aug 29, 2017
@u01jmg3 u01jmg3 added this to the v2.x.x milestone Aug 29, 2017
@u01jmg3 u01jmg3 removed their assignment Sep 26, 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