Prevent from fatal errors on events without end date (#5307)
This commit is contained in:
parent
0c6ddd1a1a
commit
ae0ea2e242
2 changed files with 9 additions and 2 deletions
|
@ -49,8 +49,11 @@ class kolab_date_recurrence
|
||||||
|
|
||||||
if (is_object($data['start']) && is_object($data['end']))
|
if (is_object($data['start']) && is_object($data['end']))
|
||||||
$this->duration = $data['start']->diff($data['end']);
|
$this->duration = $data['start']->diff($data['end']);
|
||||||
else
|
else {
|
||||||
$this->duration = new DateInterval('PT' . ($data['end'] - $data['start']) . 'S');
|
// Prevent from errors when end date is not set (#5307) RFC5545 3.6.1
|
||||||
|
$seconds = !empty($data['end']) ? ($data['end'] - $data['start']) : 0;
|
||||||
|
$this->duration = new DateInterval('PT' . $seconds . 'S');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -189,6 +189,10 @@ class kolab_format_event extends kolab_format_xcal
|
||||||
$object['end'] = clone $object['start'];
|
$object['end'] = clone $object['start'];
|
||||||
$object['end']->add($interval);
|
$object['end']->add($interval);
|
||||||
}
|
}
|
||||||
|
// make sure end date is specified (#5307) RFC5545 3.6.1
|
||||||
|
else if (!$object['end'] && $object['start']) {
|
||||||
|
$object['end'] = clone $object['start'];
|
||||||
|
}
|
||||||
|
|
||||||
// organizer is part of the attendees list in Roundcube
|
// organizer is part of the attendees list in Roundcube
|
||||||
if ($object['organizer']) {
|
if ($object['organizer']) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue