[Tickets #3243] NEW: PHP fatal error if DTEND is not present in imported iCalendar file
bugs@bugs.horde.org
bugs at bugs.horde.org
Wed Jan 11 02:44:26 PST 2006
DO NOT REPLY TO THIS MESSAGE. THIS EMAIL ADDRESS IS NOT MONITORED.
Ticket URL: http://bugs.horde.org/ticket/?id=3243
-----------------------------------------------------------------------
Ticket | 3243
Created By | gauret at free.fr
Summary | PHP fatal error if DTEND is not present in imported iCalendar file
Queue | Kronolith
Version | 2.0.6
State | Unconfirmed
Priority | 1. Low
Type | Bug
Owners |
+New Attachment | failed-event.ics
-----------------------------------------------------------------------
gauret at free.fr (2006-01-11 02:44) wrote:
An iCalendar event can have no DTEND attribute, in which case the end 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.
More information about the bugs
mailing list