Fix "PHP Fatal error: Call to a member function setTimezone() on a
non-object" when parsing occurences of recurring events, where 'changed' date is not set (Bug #2185)
This commit is contained in:
parent
9f8c4d547e
commit
ea949c7992
2 changed files with 6 additions and 2 deletions
|
@ -1205,7 +1205,8 @@ class calendar extends rcube_plugin
|
|||
'_id' => $event['calendar'] . ':' . $event['id'], // unique identifier for fullcalendar
|
||||
'start' => $this->lib->adjust_timezone($event['start'])->format('c'),
|
||||
'end' => $this->lib->adjust_timezone($event['end'])->format('c'),
|
||||
'changed' => $this->lib->adjust_timezone($event['changed'])->format('c'),
|
||||
// 'changed' might be empty for event recurrences (Bug #2185)
|
||||
'changed' => $event['changed'] ? $this->lib->adjust_timezone($event['changed'])->format('c') : null,
|
||||
'title' => strval($event['title']),
|
||||
'description' => strval($event['description']),
|
||||
'location' => strval($event['location']),
|
||||
|
|
|
@ -120,7 +120,10 @@ class libcalendaring extends rcube_plugin
|
|||
else if (is_string($dt))
|
||||
$dt = new DateTime($dt);
|
||||
|
||||
$dt->setTimezone($this->timezone);
|
||||
if ($dt instanceof DateTime) {
|
||||
$dt->setTimezone($this->timezone);
|
||||
}
|
||||
|
||||
return $dt;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue