summaryrefslogtreecommitdiffstats
path: root/post_bug.cgi
diff options
context:
space:
mode:
authorkiko%async.com.br <>2004-07-23 02:48:37 +0200
committerkiko%async.com.br <>2004-07-23 02:48:37 +0200
commit28fa2f54b2c400ff2067a7e76f1af5f7d361908b (patch)
treed3994ba52e8825d2bd5756734335977f0ef50f90 /post_bug.cgi
parenteffe8d6362e02436673ae80c019a13769dd424cb (diff)
downloadbugzilla-28fa2f54b2c400ff2067a7e76f1af5f7d361908b.tar.gz
bugzilla-28fa2f54b2c400ff2067a7e76f1af5f7d361908b.tar.xz
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 <michetti@grad.icmc.usp.br>. r=kiko, a=justdave.
Diffstat (limited to 'post_bug.cgi')
-rwxr-xr-xpost_bug.cgi8
1 files changed, 2 insertions, 6 deletions
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";
}