Summary | PHP fatal error if DTEND is not present in imported iCalendar file |
Queue | Kronolith |
Queue Version | 2.0.6 |
Type | Bug |
State | Resolved |
Priority | 1. Low |
Owners | |
Requester | gauret (at) free (dot) fr |
Created | 01/11/2006 (7087 days ago) |
Due | |
Updated | 01/11/2006 (7087 days ago) |
Assigned | |
Resolved | 01/11/2006 (7087 days ago) |
Github Issue Link | |
Github Pull Request | |
Milestone | |
Patch | No |
State ⇒ Resolved
State ⇒ Unconfirmed
Priority ⇒ 1. Low
Type ⇒ Bug
Summary ⇒ PHP fatal error if DTEND is not present in imported iCalendar file
Queue ⇒ Kronolith
New Attachment: failed-event.ics
date is considered to be equal to the start date. From
http://www.ietf.org/rfc/rfc2445.txt :
« For cases where a "VEVENT" calendar component specifies a "DTSTART"
property with a DATE data type but no "DTEND" property, the events
non-inclusive end is the end of the calendar date specified by the
"DTSTART" property. For cases where a "VEVENT" calendar component
specifies a "DTSTART" property with a DATE-TIME data type but no
"DTEND" property, the event ends on the same calendar date and time
of day specified by the "DTSTART" property. »
I have attached an event which fails to import properly in the latest
stable Kronolith.
Here's a very simple patch to make it work :
--- lib/Driver.php.orig Wed Jan 11 11:36:09 2006
+++ lib/Driver.php Wed Jan 11 11:34:40 2006
@@ -603,6 +603,8 @@
$duration = $vEvent->getAttribute('DURATION');
if (!is_array($duration) && !is_a($duration, 'PEAR_Error')) {
$this->end = &new
Horde_Date($this->start->timestamp() + $duration);
+ } else { // Neither DTEND nor DURATION : end date is
start date (see rfc)
+ $this->end = $this->start;
}
}
Feel free to adapt it to your needs of course.