diff --git a/inc/RRule.php b/inc/RRule.php index 270df21f..380c33b1 100644 --- a/inc/RRule.php +++ b/inc/RRule.php @@ -1157,6 +1157,7 @@ function rdate_expand( $dtstart, $property, $component, $range_end = null, $is_d * @return array An array keyed on the UTC dates, referring to the component */ function rrule_expand( $dtstart, $property, $component, $range_end, $is_date=null, $return_floating_times=false, $fallback_tzid=null ) { + global $c; $expansion = array(); $recur = $component->GetProperty($property); @@ -1176,11 +1177,15 @@ function rrule_expand( $dtstart, $property, $component, $range_end, $is_date=nul if ( DEBUG_RRULE ) printf( "RRULE: %s (floating: %s)\n", $recur, ($return_floating_times?"yes":"no") ); $rule = new RepeatRule( $this_start, $recur, $is_date, $return_floating_times ); $i = 0; - $result_limit = 1000; + + if ( !isset($c->rrule_expansion_limit) ) $c->rrule_expansion_limit = 5000; while( $date = $rule->next($return_floating_times) ) { // if ( DEBUG_RRULE ) printf( "[%3d] %s\n", $i, $date->UTC() ); $expansion[$date->FloatOrUTC($return_floating_times)] = $component; - if ( $i++ >= $result_limit || $date > $range_end ) break; + if ( $date > $range_end ) break; + if ( $i++ >= $c->rrule_expansion_limit ) { + dbg_error_log( 'ERROR', "Hit rrule expansion limit of ".$c->rrule_expansion_limit." - increase rrule_expansion_limit in config to avoid events missing from freebusy" ); + } } // if ( DEBUG_RRULE ) print_r( $expansion ); return $expansion; diff --git a/testing/tests/scheduling/3021-POST-availability.result b/testing/tests/scheduling/3021-POST-availability.result index 9aa472f5..0d4bca63 100644 --- a/testing/tests/scheduling/3021-POST-availability.result +++ b/testing/tests/scheduling/3021-POST-availability.result @@ -36,6 +36,7 @@ BEGIN:VFREEBUSY DTSTAMP:yyyymmddThhmmssZ DTSTART:20111018T110000Z DTEND:20111019T110000Z +FREEBUSY:20111018T180000Z/20111019T040000Z UID:E9F98477-A9C2-43F9-8371-CBA0CBCB0300 ORGANIZER:mailto:manager1@example.net ATTENDEE:mailto:user1@example.net diff --git a/testing/tests/scheduling/3022-POST-availability.result b/testing/tests/scheduling/3022-POST-availability.result index 1074bd33..b74e3761 100644 --- a/testing/tests/scheduling/3022-POST-availability.result +++ b/testing/tests/scheduling/3022-POST-availability.result @@ -35,6 +35,7 @@ BEGIN:VFREEBUSY DTSTAMP:yyyymmddThhmmssZ DTSTART:20111024T110000Z DTEND:20111025T110000Z +FREEBUSY:20111024T180000Z/20111025T040000Z FREEBUSY:20111024T184500Z/20111024T193000Z FREEBUSY:20111024T220000Z/20111025T030000Z UID:01B40176-4934-46AE-9C0A-19ECC41200E6