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.19.2.2 -r1.19.2.3 --- openacs-4/packages/acs-tcl/tcl/tcl-documentation-procs.tcl 27 Jul 2005 15:29:54 -0000 1.19.2.2 +++ openacs-4/packages/acs-tcl/tcl/tcl-documentation-procs.tcl 25 Nov 2005 11:13:05 -0000 1.19.2.3 @@ -1477,13 +1477,20 @@ @author Lars Pind (lars@pinds.com) @creation-date 25 July 2000 } { - if { ![regexp {^(-)?(0*)(([1-9][0-9]*|0))$} $value match sign zeros value] } { - ad_complain "[_ acs-tcl.lt_name_is_not_an_intege]" - return 0 - } + # first simple a quick check avoiding the slow regexp + if {[string is integer $value]} { + return 1 + } + if { [regexp {^(-)?(0*)([1-9][0-9]*|0)$} $value match sign zeros value] } { # Trim the value for any leading zeros set value $sign$value - return 1 + # the string might be still to large, so check again... + if {[string is integer $value]} { + return 1 + } + } + ad_complain "[_ acs-tcl.lt_name_is_not_an_intege]" + return 0 } ad_page_contract_filter naturalnum { name value } { @@ -1493,11 +1500,13 @@ @author Lars Pind (lars@pinds.com) @creation-date 25 July 2000 } { - if { ![regexp {^(0*)(([1-9][0-9]*|0))$} $value match zeros value] } { - ad_complain "[_ acs-tcl.lt_name_is_not_a_natural]" - return 0 + if { [regexp {^(0*)([1-9][0-9]*|0)$} $value match zeros value] } { + if {[string is integer $value]} { + return 1 + } } - return 1 + ad_complain "[_ acs-tcl.lt_name_is_not_a_natural]" + return 0 } ad_page_contract_filter range { name value range } {