aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlpsolit%gmail.com <>2006-02-28 20:52:31 +0000
committerlpsolit%gmail.com <>2006-02-28 20:52:31 +0000
commitda1db1402be5d249990d1beb5f41390b92f7e0be (patch)
tree2ad0914796b973db2dbd0f6a9145e961d3f0568e /post_bug.cgi
parentDocumentation patch for bug 213262: add instructions on how to get sendmail t... (diff)
downloadbugzilla-da1db1402be5d249990d1beb5f41390b92f7e0be.tar.gz
bugzilla-da1db1402be5d249990d1beb5f41390b92f7e0be.tar.bz2
bugzilla-da1db1402be5d249990d1beb5f41390b92f7e0be.zip
Bug 315605: Bugzilla::Field::check_form_field() should not take a CGI object as parameter - Patch by Frédéric Buclin <LpSolit@gmail.com> r=wicked a=justdave
Diffstat (limited to 'post_bug.cgi')
-rwxr-xr-xpost_bug.cgi27
1 files changed, 15 insertions, 12 deletions
diff --git a/post_bug.cgi b/post_bug.cgi
index 4d8c6a2c9..296979b79 100755
--- a/post_bug.cgi
+++ b/post_bug.cgi
@@ -197,18 +197,21 @@ if (!Param('letsubmitterchoosepriority')) {
GetVersionTable();
# Some more sanity checking
-check_form_field($cgi, 'product', \@::legal_product);
-check_form_field($cgi, 'rep_platform', \@::legal_platform);
-check_form_field($cgi, 'bug_severity', \@::legal_severity);
-check_form_field($cgi, 'priority', \@::legal_priority);
-check_form_field($cgi, 'op_sys', \@::legal_opsys);
-check_form_field($cgi, 'bug_status', ['UNCONFIRMED', 'NEW']);
-check_form_field($cgi, 'version', $::versions{$product});
-check_form_field($cgi, 'component', $::components{$product});
-check_form_field($cgi, 'target_milestone', $::target_milestone{$product});
-check_form_field_defined($cgi, 'assigned_to');
-check_form_field_defined($cgi, 'bug_file_loc');
-check_form_field_defined($cgi, 'comment');
+check_field('product', scalar $cgi->param('product'), \@::legal_product);
+check_field('rep_platform', scalar $cgi->param('rep_platform'), \@::legal_platform);
+check_field('bug_severity', scalar $cgi->param('bug_severity'), \@::legal_severity);
+check_field('priority', scalar $cgi->param('priority'), \@::legal_priority);
+check_field('op_sys', scalar $cgi->param('op_sys'), \@::legal_opsys);
+check_field('bug_status', scalar $cgi->param('bug_status'), ['UNCONFIRMED', 'NEW']);
+check_field('version', scalar $cgi->param('version'), $::versions{$product});
+check_field('component', scalar $cgi->param('component'), $::components{$product});
+check_field('target_milestone', scalar $cgi->param('target_milestone'),
+ $::target_milestone{$product});
+
+foreach my $field_name ('assigned_to', 'bug_file_loc', 'comment') {
+ defined($cgi->param($field_name))
+ || ThrowCodeError('undefined_field', { field => $field_name });
+}
my $everconfirmed = ($cgi->param('bug_status') eq 'UNCONFIRMED') ? 0 : 1;
$cgi->param(-name => 'everconfirmed', -value => $everconfirmed);