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 -r1.61.2.9 -r1.61.2.10 --- openacs-4/packages/acs-tcl/tcl/tcl-documentation-procs.tcl 27 Nov 2020 09:27:43 -0000 1.61.2.9 +++ openacs-4/packages/acs-tcl/tcl/tcl-documentation-procs.tcl 22 Apr 2021 18:47:25 -0000 1.61.2.10 @@ -2187,6 +2187,25 @@ return 0 } +ad_page_contract_filter printable { name value } { + + Checks whether the value contains only characters with a printable + representation. This represents character class of the Tcl + character class "print", which consists of the characters with a + visible representation and space. This filter is useful for + e.g. avoiding invalid byte sequences for the database. + + @author Gustaf Neumann + @creation-date 22 April 2021 +} { + + if {![regexp {[^[:print:]]} $value]} { + return 1 + } + ad_complain [_ acs-tcl.lt_name_contains_invalid] + return 0 +} + ad_page_contract_filter path { name value } { Checks whether the value is a Tcl word, or contains a few rather safe other characters ("-", "/", ".") used