From 9612f5b87b1503cdfc56c8170bead7cd47de783e Mon Sep 17 00:00:00 2001 From: "bbaetz%student.usyd.edu.au" <> Date: Tue, 5 Feb 2002 08:20:07 +0000 Subject: Bug 119715 - strictvaluechecks should always be enabled r=justdave, gerv --- process_bug.cgi | 46 +++++++++++++++++----------------------------- 1 file changed, 17 insertions(+), 29 deletions(-) (limited to 'process_bug.cgi') diff --git a/process_bug.cgi b/process_bug.cgi index dcde93035..15daf152b 100755 --- a/process_bug.cgi +++ b/process_bug.cgi @@ -102,15 +102,13 @@ PutHeader ("Bug processed"); GetVersionTable(); -if ( Param("strictvaluechecks") ) { - CheckFormFieldDefined(\%::FORM, 'product'); - CheckFormFieldDefined(\%::FORM, 'version'); - CheckFormFieldDefined(\%::FORM, 'component'); +CheckFormFieldDefined(\%::FORM, 'product'); +CheckFormFieldDefined(\%::FORM, 'version'); +CheckFormFieldDefined(\%::FORM, 'component'); - # check if target milestone is defined - matthew@zeroknowledge.com - if ( Param("usetargetmilestone") ) { - CheckFormFieldDefined(\%::FORM, 'target_milestone'); - } +# check if target milestone is defined - matthew@zeroknowledge.com +if ( Param("usetargetmilestone") ) { + CheckFormFieldDefined(\%::FORM, 'target_milestone'); } ConnectToDatabase(); @@ -155,9 +153,7 @@ if ((($::FORM{'id'} && $::FORM{'product'} ne $::oldproduct) || (!$::FORM{'id'} && $::FORM{'product'} ne $::dontchange)) && CheckonComment( "reassignbycomponent" )) { - if ( Param("strictvaluechecks") ) { - CheckFormField(\%::FORM, 'product', \@::legal_product); - } + CheckFormField(\%::FORM, 'product', \@::legal_product); my $prod = $::FORM{'product'}; # note that when this script is called from buglist.cgi (rather @@ -431,7 +427,7 @@ Do you wish to do this?

exit; } # end DuplicateUserConfirm() -if (defined $::FORM{'id'} && Param('strictvaluechecks')) { +if (defined $::FORM{'id'}) { # since this means that we were called from show_bug.cgi, now is a good # time to do a whole bunch of error checking that can't easily happen when # we've been called from buglist.cgi, because buglist.cgi only tweaks @@ -668,9 +664,7 @@ if (defined $::FORM{newcc} || defined $::FORM{removecc} || defined $::FORM{massc } -if ( Param('strictvaluechecks') ) { - CheckFormFieldDefined(\%::FORM, 'knob'); -} +CheckFormFieldDefined(\%::FORM, 'knob'); SWITCH: for ($::FORM{'knob'}) { /^none$/ && do { last SWITCH; @@ -707,14 +701,12 @@ SWITCH: for ($::FORM{'knob'}) { } ChangeStatus('NEW'); DoComma(); - if ( Param("strictvaluechecks") ) { - if ( !defined$::FORM{'assigned_to'} || - trim($::FORM{'assigned_to'}) eq "") { - PuntTryAgain("You cannot reassign to a bug to nobody. Unless " . - "you intentionally cleared out the " . - "\"Reassign bug to\" field, " . - Param("browserbugmessage")); - } + if ( !defined$::FORM{'assigned_to'} || + trim($::FORM{'assigned_to'}) eq "") { + PuntTryAgain("You cannot reassign to a bug to nobody. Unless " . + "you intentionally cleared out the " . + "\"Reassign bug to\" field, " . + Param("browserbugmessage")); } my $newid = DBNameToIdAndCheck($::FORM{'assigned_to'}); $::query .= "assigned_to = $newid"; @@ -772,9 +764,7 @@ SWITCH: for ($::FORM{'knob'}) { /^duplicate$/ && CheckonComment( "duplicate" ) && do { ChangeStatus('RESOLVED'); ChangeResolution('DUPLICATE'); - if ( Param('strictvaluechecks') ) { - CheckFormFieldDefined(\%::FORM,'dup_id'); - } + CheckFormFieldDefined(\%::FORM,'dup_id'); my $num = trim($::FORM{'dup_id'}); SendSQL("SELECT bug_id FROM bugs WHERE bug_id = " . SqlQuote($num)); $num = FetchOneColumn(); @@ -1395,9 +1385,7 @@ The changes made were: SendSQL("INSERT INTO cc (who, bug_id) VALUES ($reporter, " . SqlQuote($duplicate) . ")"); } AppendComment($duplicate, $::COOKIE{'Bugzilla_login'}, "*** Bug $::FORM{'id'} has been marked as a duplicate of this bug. ***"); - if ( Param('strictvaluechecks') ) { - CheckFormFieldDefined(\%::FORM,'comment'); - } + CheckFormFieldDefined(\%::FORM,'comment'); SendSQL("INSERT INTO duplicates VALUES ($duplicate, $::FORM{'id'})"); print "

Duplicate notation added to bug $duplicate

\n"; system("./processmail", $duplicate, $::COOKIE{'Bugzilla_login'}); -- cgit v1.2.3-24-g4f1b