From: terry%netscape.com <> Date: Thu, 27 Aug 1998 07:03:27 +0000 (+0000) Subject: Don't choke if the user hits a space or something in the 'changed in X-Git-Tag: bugzilla-1.3~48 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7b4718459fcfb0872c381588753e752be27e0b11;p=thirdparty%2Fbugzilla.git Don't choke if the user hits a space or something in the 'changed in last ___ days' field. --- diff --git a/buglist.cgi b/buglist.cgi index 3ac68c4dfb..f6d54e4a39 100755 --- a/buglist.cgi +++ b/buglist.cgi @@ -238,7 +238,18 @@ if {[info exists FORM(sql)]} { } if {[lookup FORM changedin] != ""} { - qadd "and to_days(now()) - to_days(bugs.delta_ts) <= $FORM(changedin) " + set c [string trim $FORM(changedin)] + if {$c != ""} { + if {![regexp {^[0-9]*$} $c]} { + puts " +The 'changed in last ___ days' field must be a simple number. You entered +\"$c\", which doesn't cut it. + +Click the Back button and try again." + exit + } + qadd "and to_days(now()) - to_days(bugs.delta_ts) <= $FORM(changedin) " + } } }