From 28fa2f54b2c400ff2067a7e76f1af5f7d361908b Mon Sep 17 00:00:00 2001 From: "kiko%async.com.br" <> Date: Fri, 23 Jul 2004 00:48:37 +0000 Subject: Fix for bug 252159: centralize time validation. Adds a ValidateTime function to Bugzilla::Bug and uses it in relevant callsites. Patch by Alexandre Michetti Manduca . r=kiko, a=justdave. --- post_bug.cgi | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'post_bug.cgi') diff --git a/post_bug.cgi b/post_bug.cgi index a751a66a6..94533e38d 100755 --- a/post_bug.cgi +++ b/post_bug.cgi @@ -342,12 +342,8 @@ if (UserInGroup(Param("timetrackinggroup")) && defined $::FORM{'estimated_time'}) { my $est_time = $::FORM{'estimated_time'}; - if ($est_time =~ /^(?:\d+(?:\.\d*)?|\.\d+)$/) { - $sql .= SqlQuote($est_time) . "," . SqlQuote($est_time); - } else { - ThrowUserError("need_positive_number", - { field => 'estimated_time' }); - } + Bugzilla::Bug::ValidateTime($est_time, 'estimated_time'); + $sql .= SqlQuote($est_time) . "," . SqlQuote($est_time); } else { $sql .= "0, 0"; } -- cgit v1.2.3-24-g4f1b