From 1f5818f624573149db6cd23e42b6663579e02cc1 Mon Sep 17 00:00:00 2001 From: Andrew McMillan Date: Thu, 29 Apr 2010 11:12:52 +1200 Subject: [PATCH] RDATE/EXDATE can occur multiply, as well as contain multiple dates. --- inc/caldav-REPORT.php | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/inc/caldav-REPORT.php b/inc/caldav-REPORT.php index b69b59ad..9835721f 100644 --- a/inc/caldav-REPORT.php +++ b/inc/caldav-REPORT.php @@ -77,14 +77,17 @@ if ( class_exists('RepeatRule') ) { * @return array An array keyed on the UTC dates, referring to the component */ function rdate_expand( $dtstart, $property, $component, $range_end = null ) { - $timezone = $component->GetPParamValue($property, 'TZID'); - $rdate = $component->GetPValue($property); - $rdates = explode( ',', $rdate ); + $properties = $component->GetProperties($property); $expansion = array(); - foreach( $rdates AS $k => $v ) { - $rdate = new RepeatRuleDateTime( $v, $timezone); - $expansion[$rdate->UTC()] = $component; - if ( $rdate > $range_end ) break; + foreach( $properties AS $p ) { + $timezone = $p->GetParameterValue('TZID'); + $rdate = $p->Value(); + $rdates = explode( ',', $rdate ); + foreach( $rdates AS $k => $v ) { + $rdate = new RepeatRuleDateTime( $v, $timezone); + $expansion[$rdate->UTC()] = $component; + if ( $rdate > $range_end ) break; + } } return $expansion; }