From 2de6abfda1e684d218b8d9b251a1153ce30f89e2 Mon Sep 17 00:00:00 2001 From: "mkanat%bugzilla.org" <> Date: Wed, 23 Aug 2006 05:30:27 +0000 Subject: Bug 349558: Move validations of global enum fields from post_bug into Bugzilla::Bug Patch By Max Kanat-Alexander r=bkor, a=justdave --- Bugzilla/Bug.pm | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'Bugzilla/Bug.pm') diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm index 9c9e2828d..406e70aca 100755 --- a/Bugzilla/Bug.pm +++ b/Bugzilla/Bug.pm @@ -262,6 +262,13 @@ sub _check_bug_file_loc { return $url; } +sub _check_bug_severity { + my ($severity) = @_; + $severity = trim($severity); + check_field('bug_severity', $severity); + return $severity; +} + sub _check_bug_status { my ($status, $product) = @_; my $user = Bugzilla->user; @@ -363,6 +370,31 @@ sub _check_product { return $obj; } +sub _check_op_sys { + my ($op_sys) = @_; + $op_sys = trim($op_sys); + check_field('op_sys', $op_sys); + return $op_sys; +} + +sub _check_priority { + my ($priority) = @_; + if (!Bugzilla->params->{'letsubmitterchoosepriority'}) { + $priority = Bugzilla->params->{'defaultpriority'}; + } + $priority = trim($priority); + check_field('priority', $priority); + + return $priority; +} + +sub _check_rep_platform { + my ($platform) = @_; + $platform = trim($platform); + check_field('rep_platform', $platform); + return $platform; +} + sub _check_short_desc { my ($short_desc) = @_; # Set the parameter to itself, but cleaned up -- cgit v1.2.3-24-g4f1b