mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-23 00:13:35 +01:00
Handle failures in event2rrule gracefully
This commit is contained in:
parent
3a09d2072f
commit
20aab1b6f2
@ -627,10 +627,11 @@ class calendar_rrule implements Iterator
|
||||
* @param boolean $usertime=true true: event timestamps are usertime (default for calendar_bo::(read|search), false: servertime
|
||||
* @param string $to_tz timezone for exports (null for event's timezone)
|
||||
*
|
||||
* @return calendar_rrule
|
||||
* @return calendar_rrule false on error
|
||||
*/
|
||||
public static function event2rrule(array $event,$usertime=true,$to_tz=null)
|
||||
{
|
||||
if (!is_array($event) || !isset($event['tzid'])) return false;
|
||||
if (!$to_tz) $to_tz = $event['tzid'];
|
||||
$timestamp_tz = $usertime ? egw_time::$user_timezone : egw_time::$server_timezone;
|
||||
$time = is_a($event['start'],'DateTime') ? $event['start'] : new egw_time($event['start'],$timestamp_tz);
|
||||
|
Loading…
Reference in New Issue
Block a user