summaryrefslogtreecommitdiffstats
path: root/post_bug.cgi
diff options
context:
space:
mode:
authordmose%mozilla.org <>1999-12-03 08:21:40 +0100
committerdmose%mozilla.org <>1999-12-03 08:21:40 +0100
commit054be7c4ef0b5ace9155df00654b48fafd137a3a (patch)
tree58cb8b7e3db887e4c1dc69ead41ef0a6b30c603a /post_bug.cgi
parent1e216d4eb54fcb827f6910d578f54d92839147a1 (diff)
downloadbugzilla-054be7c4ef0b5ace9155df00654b48fafd137a3a.tar.gz
bugzilla-054be7c4ef0b5ace9155df00654b48fafd137a3a.tar.xz
a bug fix or two and a whole bunch of sanity-checking of form submissions stuff
Diffstat (limited to 'post_bug.cgi')
-rwxr-xr-xpost_bug.cgi22
1 files changed, 18 insertions, 4 deletions
diff --git a/post_bug.cgi b/post_bug.cgi
index 668baf2e7..ac8dd718d 100755
--- a/post_bug.cgi
+++ b/post_bug.cgi
@@ -19,7 +19,7 @@
# Rights Reserved.
#
# Contributor(s): Terry Weissman <terry@mozilla.org>
-
+# Dan Mosedale <dmose@mozilla.org>
use diagnostics;
use strict;
@@ -63,7 +63,6 @@ if (!defined $::FORM{'component'} || $::FORM{'component'} eq "") {
print "and choose a component.\n";
exit 0
}
-
if (!defined $::FORM{'short_desc'} || trim($::FORM{'short_desc'}) eq "") {
print "You must enter a summary for this bug. Please hit the\n";
@@ -71,6 +70,22 @@ if (!defined $::FORM{'short_desc'} || trim($::FORM{'short_desc'}) eq "") {
exit;
}
+if ( Param("strictvaluechecks") ) {
+ GetVersionTable();
+ CheckFormField(\%::FORM, 'reporter');
+ CheckFormField(\%::FORM, 'product', \@::legal_product);
+ CheckFormField(\%::FORM, 'version', \@{$::versions{$::FORM{'product'}}});
+ CheckFormField(\%::FORM, 'rep_platform', \@::legal_platform);
+ CheckFormField(\%::FORM, 'bug_severity', \@::legal_severity);
+ CheckFormField(\%::FORM, 'priority', \@::legal_priority);
+ CheckFormField(\%::FORM, 'op_sys', \@::legal_opsys);
+ CheckFormFieldDefined(\%::FORM, 'assigned_to');
+ CheckFormField(\%::FORM, 'bug_status', \@::legal_bug_status);
+ CheckFormFieldDefined(\%::FORM, 'bug_file_loc');
+ CheckFormField(\%::FORM, 'component',
+ \@{$::components{$::FORM{'product'}}});
+ CheckFormFieldDefined(\%::FORM, 'comment');
+}
my $forceAssignedOK = 0;
if ($::FORM{'assigned_to'} eq "") {
@@ -87,8 +102,7 @@ $::FORM{'reporter'} = DBNameToIdAndCheck($::FORM{'reporter'});
my @bug_fields = ("reporter", "product", "version", "rep_platform",
"bug_severity", "priority", "op_sys", "assigned_to",
- "bug_status", "bug_file_loc", "short_desc", "component",
- "status_whiteboard", "target_milestone");
+ "bug_status", "bug_file_loc", "short_desc", "component");
if (Param("useqacontact")) {
SendSQL("select initialqacontact from components where program=" .