Index: openacs-4/packages/acs-tcl/catalog/acs-tcl.en_US.ISO-8859-1.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/catalog/acs-tcl.en_US.ISO-8859-1.xml,v diff -u -N -r1.24 -r1.25 --- openacs-4/packages/acs-tcl/catalog/acs-tcl.en_US.ISO-8859-1.xml 27 Oct 2014 16:40:04 -0000 1.24 +++ openacs-4/packages/acs-tcl/catalog/acs-tcl.en_US.ISO-8859-1.xml 24 Jun 2015 07:10:29 -0000 1.25 @@ -45,6 +45,8 @@ %name% is not a natural number, that is an integer greater than or equal to 0. %name% is not a valid SQL identifier %name% is not an integer + %name% contains non-word characters + %name% contains invalid characters %name% is not in the range [%min%, %max%] %name% is too long. Please enter a value of at most %max_length% characters long. The value you entered is %actual_length% characters long. This string looks broken! Index: openacs-4/packages/acs-tcl/tcl/tcl-documentation-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/tcl-documentation-procs.tcl,v diff -u -N -r1.31 -r1.32 --- openacs-4/packages/acs-tcl/tcl/tcl-documentation-procs.tcl 27 Oct 2014 16:40:08 -0000 1.31 +++ openacs-4/packages/acs-tcl/tcl/tcl-documentation-procs.tcl 24 Jun 2015 07:10:29 -0000 1.32 @@ -1961,7 +1961,7 @@ } { if { [string trim $value] ne "" && ![regexp {[1-9][0-9][0-9]-[0-9][0-9][0-9]-[0-9][0-9][0-9][0-9]} $value]} { - ad_complain "[_ acs-tcl.lt_name_does_not_appear__1]" + ad_complain [_ acs-tcl.lt_name_does_not_appear__1] return 0 } return 1 @@ -1979,25 +1979,43 @@ if {[string is boolean -strict $value]} { return 1 } - # set lcase_value [string tolower $value] - # if {$value eq "0" || $value eq "1" - # || $lcase_value eq "f" || $lcase_value eq "t" - # || $lcase_value eq "y" || $lcase_value eq "n" || - # || $lcase_value eq "true" || $lcase_value eq "false" - # || $lcase_value eq "yes" || $lcase_value eq "no" - # } { - # return 1 - # } - ad_complain "[_ acs-tcl.lt_name_does_not_appear__2]" + ad_complain [_ acs-tcl.lt_name_does_not_appear__2] return 0 } +ad_page_contract_filter word { name value } { + Checks whether the value is a Tcl word, i.e. it consists of just + characters, digits and underscore. + @author Gustaf Neumann + @creation-date 24 June 2015 +} { + if {[regexp {^\w+$} $value]} { + return 1 + } + ad_complain [_ acs-tcl.lt_name_is_not_a_word] + return 0 +} +ad_page_contract_filter wordplus { name value } { + Checks whether the value is a Tcl word, or some more + rather safe characters. + @author Gustaf Neumann + @creation-date 24 June 2015 +} { + if {[regexp {^[\w,-]+$} $value]} { + return 1 + } + ad_complain [_ acs-tcl.lt_name_contains_invalid] + return 0 +} + + + #################### # # Standard filter rules @@ -2029,8 +2047,6 @@ } - - #################### # # Templating system things