Check for valid datetime object before cloning (#3958)

This commit is contained in:
Thomas Bruederli 2015-01-08 13:46:20 +01:00
parent 3af4b1c4f8
commit 1dd6cc8a0b

View file

@ -1351,7 +1351,7 @@ class kolab_driver extends calendar_driver
$record['id'] = $record['uid'];
// all-day events go from 12:00 - 13:00
if ($record['end'] <= $record['start'] && $record['allday']) {
if (is_a($record['start'], 'DateTime') && $record['end'] <= $record['start'] && $record['allday']) {
$record['end'] = clone $record['start'];
$record['end']->add(new DateInterval('PT1H'));
}