fixed 5.4 PHP Warning: Illegal string offset 'start' or 'end'

This commit is contained in:
Ralf Becker 2012-07-02 08:14:46 +00:00
parent fd6a7ea790
commit fcf313e900

View File

@ -533,12 +533,15 @@ class calendar_boupdate extends calendar_bo
case 'time_change_4h':
case 'time_change':
default:
$diff = max(abs(self::date2ts($old_event['start'])-self::date2ts($new_event['start'])),
abs(self::date2ts($old_event['end'])-self::date2ts($new_event['end'])));
$check = $ru == 'time_change_4h' ? 4 * 60 * 60 - 1 : 0;
if ($msg_type == MSG_MODIFIED && $diff > $check)
if (is_array($new_event) && is_array($old_event))
{
++$want_update;
$diff = max(abs(self::date2ts($old_event['start'])-self::date2ts($new_event['start'])),
abs(self::date2ts($old_event['end'])-self::date2ts($new_event['end'])));
$check = $ru == 'time_change_4h' ? 4 * 60 * 60 - 1 : 0;
if ($msg_type == MSG_MODIFIED && $diff > $check)
{
++$want_update;
}
}
case 'add_cancel':
if ($msg_is_response && ($old_event['owner'] == $userid || $role == 'CHAIR') ||