diff --git a/config/example-config.php b/config/example-config.php index 21903cdf..1c4c6e9b 100644 --- a/config/example-config.php +++ b/config/example-config.php @@ -433,6 +433,18 @@ $c->admin_email ='calendar-admin@example.com'; */ // $c->disable_caldav_proxy_propfind_collections = array( 'User-Agent'=>'#regex1#', 'X-Client'=>'#regex2#'); +/** +* A limiter on how many times we'll apply the recurrence rules for an event +* to find the next valid one. +* +* Default: 100 +* +* If you see the following error message, you may want to consider increasing +* it: +* RRULE, loop limit has been hit in GetMoreInstances, you probably want to increase $c->rrule_loop_limit +*/ +// $c->rrule_loop_limit = 100; + /** * EXPERIMENTAL: * If true, names of groups (prefixed with "@") given as an event attendee diff --git a/htdocs/always.php b/htdocs/always.php index bf6afd9a..b3f8cc57 100644 --- a/htdocs/always.php +++ b/htdocs/always.php @@ -109,11 +109,11 @@ function early_catch_fatal_error() { register_shutdown_function('early_catch_fatal_error'); $c->default_timezone = ini_get ( 'date.timezone' ); -if (empty ( $c->default_timezone )) { +if (isset ( $_SERVER ['HTTP_X_DAVICAL_TESTCASE'] ) ) { + $c->default_timezone = 'Pacific/Auckland'; +} +else if (empty ( $c->default_timezone )) { $c->default_timezone = 'UTC'; - if (isset ( $_SERVER ['HTTP_X_DAVICAL_TESTCASE'] )) { - $c->default_timezone = 'Pacific/Auckland'; - } } // Default some of the configurable values @@ -160,6 +160,10 @@ $c->readonly_webdav_collections = true; // WebDAV access is readonly // Kind of private configuration values $c->total_query_time = 0; +// Any many times GetMoreInstances in inc/RRule.php should loop trying to +// find more instances. +$c->rrule_loop_limit = 100; + $c->dbg = array(); diff --git a/inc/RRule.php b/inc/RRule.php index eb982143..a58110d3 100644 --- a/inc/RRule.php +++ b/inc/RRule.php @@ -815,14 +815,14 @@ class RepeatRule { } private function GetMoreInstances($return_floating_times=false) { + global $c; if ( $this->finished ) return; $got_more = false; - $loop_limit = 100; $loops = 0; if ( $return_floating_times ) $this->base->setAsFloat(); while( !$this->finished && !$got_more) { - if ($loops++ > $loop_limit ) { - dbg_error_log ('ERROR', "RRULE, loop limit has been hit in GetMoreInstances, this probably needs to be increased (loop_limit: %d)", $loop_limit); + if ($loops++ > $c->rrule_loop_limit ) { + dbg_error_log ('ERROR', "RRULE, loop limit has been hit in GetMoreInstances, you probably want to increase \$c->rrule_loop_limit (currently %d)", $c->rrule_loop_limit); break; } diff --git a/inc/always.php.in b/inc/always.php.in index 2fc13485..9a2e7e9c 100644 --- a/inc/always.php.in +++ b/inc/always.php.in @@ -160,6 +160,10 @@ $c->readonly_webdav_collections = true; // WebDAV access is readonly // Kind of private configuration values $c->total_query_time = 0; +// Any many times GetMoreInstances in inc/RRule.php should loop trying to +// find more instances. +$c->rrule_loop_limit = 100; + $c->dbg = array();