From 18c550b6929619a809b6095206a42bdf59bc7450 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Tue, 2 Mar 2021 15:26:55 +0200 Subject: [PATCH] * CalDAV/Calendar: fix weekly recurring events without explicit weekday (BYDAY) were not using start-date --- calendar/inc/class.calendar_ical.inc.php | 2 +- calendar/inc/class.calendar_rrule.inc.php | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/calendar/inc/class.calendar_ical.inc.php b/calendar/inc/class.calendar_ical.inc.php index ee806f5f19..5cf1722ee8 100644 --- a/calendar/inc/class.calendar_ical.inc.php +++ b/calendar/inc/class.calendar_ical.inc.php @@ -2707,7 +2707,7 @@ class calendar_ical extends calendar_boupdate break; case 'RRULE': unset($vcardData['recur_type']); // it wont be set by += - $vcardData += calendar_rrule::parseRrule($attributes['value']); + $vcardData += calendar_rrule::parseRrule($attributes['value'], false, $vcardData); if (!empty($vcardData['recur_enddate'])) self::check_fix_endate ($vcardData); break; case 'EXDATE': // current Horde_Icalendar returns dates, no timestamps diff --git a/calendar/inc/class.calendar_rrule.inc.php b/calendar/inc/class.calendar_rrule.inc.php index e8504248a0..d14055a015 100644 --- a/calendar/inc/class.calendar_rrule.inc.php +++ b/calendar/inc/class.calendar_rrule.inc.php @@ -982,13 +982,13 @@ class calendar_rrule implements Iterator /** * Parse an iCal recurrence-rule string * - * @param type $recurence + * @param string $recurence * @param bool $support_below_daily =false true: support FREQ=HOURLY|MINUTELY - * @return type + * @param array $vcardData =[] already parsed values, specially value for "start" is used if no explicit BYDAY attribute + * @return array */ - public static function parseRrule($recurence, $support_below_daily=false) + public static function parseRrule($recurence, $support_below_daily=false, array $vcardData=[]) { - $vcardData = array(); $vcardData['recur_interval'] = 1; $matches = null; $type = preg_match('/FREQ=([^;: ]+)/i',$recurence,$matches) ? $matches[1] : $recurence[0];