From 054be7c4ef0b5ace9155df00654b48fafd137a3a Mon Sep 17 00:00:00 2001 From: "dmose%mozilla.org" <> Date: Fri, 3 Dec 1999 07:21:40 +0000 Subject: a bug fix or two and a whole bunch of sanity-checking of form submissions stuff --- post_bug.cgi | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) (limited to 'post_bug.cgi') 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 - +# Dan Mosedale 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=" . -- cgit v1.2.3-24-g4f1b