Index: openacs-4/packages/calendar/www/view-list-display.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/www/view-list-display.tcl,v diff -u -r1.35.2.2 -r1.35.2.3 --- openacs-4/packages/calendar/www/view-list-display.tcl 23 May 2016 19:39:31 -0000 1.35.2.2 +++ openacs-4/packages/calendar/www/view-list-display.tcl 1 Jun 2016 20:53:48 -0000 1.35.2.3 @@ -4,8 +4,15 @@ @author Sven Schmitt (s.lrn@gmx.net) @cvs-id $Id$ } { - {period_days:integer {[parameter::get -parameter ListView_DefaultPeriodDays -default 31]}} + {period_days:integer,notnull {[parameter::get -parameter ListView_DefaultPeriodDays -default 31]}} } +} -validate { + valid_period_days -requires { period_days } { + # tcl allows in for relative times just 6 digits, including the "+" + if {$period_days > 99999} { + ad_complain "Invalid time period." + } + } } if { ![info exists show_calendar_name_p] || $show_calendar_name_p eq "" } { @@ -35,13 +42,7 @@ set calendars_clause [db_map dbqd.calendar.www.views.openacs_calendar] } -#if { (![info exists period_days] || $period_days eq "") } { -# set period_days [parameter::get -parameter ListView_DefaultPeriodDays -default 31] -#} else { -# set end_date [clock format [clock scan "+${period_days} days" -base [clock scan $start_date]] -format "%Y-%m-%d 00:00"] -#} set end_date [clock format [clock scan "+${period_days} days" -base [clock scan $start_date]] -format "%Y-%m-%d 00:00"] - set package_id [ad_conn package_id] set user_id [ad_conn user_id]