From 64c1c126c0888126fa41a82ec8b2075a855ce186 Mon Sep 17 00:00:00 2001 From: nicorac Date: Tue, 18 Dec 2018 16:04:22 +0100 Subject: [PATCH 1/2] Function calendar_ical.aggregate_periods() returns only the last event --- calendar/inc/class.calendar_ical.inc.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/calendar/inc/class.calendar_ical.inc.php b/calendar/inc/class.calendar_ical.inc.php index d8fd5da112..d161c81773 100644 --- a/calendar/inc/class.calendar_ical.inc.php +++ b/calendar/inc/class.calendar_ical.inc.php @@ -3300,9 +3300,9 @@ class calendar_ical extends calendar_boupdate // sort by start datetime uasort($events, function($a, $b) { - $diff = $a['start'] < $b['start']; + $diff = $a['start'] - $b['start']; - return !$diff ? 0 : ($diff < 0 ? -1 : 1); + return $diff == 0 ? 0 : ($diff < 0 ? -1 : 1); }); $fbdata = array(); From cb106cf4f9724e4807d0b8f241148da50a175c5b Mon Sep 17 00:00:00 2001 From: nicorac Date: Tue, 18 Dec 2018 16:20:01 +0100 Subject: [PATCH 2/2] Fixed attributes cleanup in calendar_groupdav.post() and calendar_groupdav.put() --- calendar/inc/class.calendar_groupdav.inc.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/calendar/inc/class.calendar_groupdav.inc.php b/calendar/inc/class.calendar_groupdav.inc.php index 6435b69af4..559dbda008 100644 --- a/calendar/inc/class.calendar_groupdav.inc.php +++ b/calendar/inc/class.calendar_groupdav.inc.php @@ -869,12 +869,11 @@ class calendar_groupdav extends Api\CalDAV\Handler array_shift($content_type); foreach ($content_type as $attribute) { - trim($attribute); list($key, $value) = explode('=', $attribute); - switch (strtolower($key)) + switch (strtolower(trim($key))) { case 'charset': - $charset = strtoupper(substr($value,1,-1)); + $charset = strtoupper(trim($value)); } } } @@ -1078,12 +1077,11 @@ class calendar_groupdav extends Api\CalDAV\Handler array_shift($content_type); foreach ($content_type as $attribute) { - trim($attribute); list($key, $value) = explode('=', $attribute); - switch (strtolower($key)) + switch (strtolower(trim($key))) { case 'charset': - $charset = strtoupper(substr($value,1,-1)); + $charset = strtoupper(trim($value)); } } }