]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 119715 - strictvaluechecks should always be enabled
authorbbaetz%student.usyd.edu.au <>
Tue, 5 Feb 2002 08:20:07 +0000 (08:20 +0000)
committerbbaetz%student.usyd.edu.au <>
Tue, 5 Feb 2002 08:20:07 +0000 (08:20 +0000)
r=justdave, gerv

CGI.pl
defparams.pl
post_bug.cgi
process_bug.cgi
query.cgi

diff --git a/CGI.pl b/CGI.pl
index d1a274680019925e8cd748914fb8d4074d0ba518..9875b85ddad6989efa70ce141f86866aabc64a02 100644 (file)
--- a/CGI.pl
+++ b/CGI.pl
@@ -597,7 +597,7 @@ sub make_options {
         }
     }
     if (!$found && $default ne "") {
-      if ( Param("strictvaluechecks") && $::CheckOptionValues &&
+      if ( $::CheckOptionValues &&
            ($default ne $::dontchange) && ($default ne "-All-") &&
            ($default ne "DUPLICATE") ) {
         print "Possible bug database corruption has been detected.  " .
index 819013341596401ffed10387ae670dd86eef07cf..871a30e3a3749b39101b01a5ded241c37c6d058d 100644 (file)
@@ -598,15 +598,8 @@ DefParam("allowuserdeletion",
          "b",
          0);
 
-
-DefParam("strictvaluechecks",
-         "Do stricter integrity checking on both form submission values and values read in from the database.",
-         "b",
-         0);
-
-
 DefParam("browserbugmessage",
-         "If strictvaluechecks is on, and the bugzilla gets unexpected data from the browser, in addition to displaying the cause of the problem, it will output this HTML as well.",
+         "If bugzilla gets unexpected data from the browser, in addition to displaying the cause of the problem, it will output this HTML as well.",
          "l",
          "this may indicate a bug in your browser.\n");
 
index 361cba848ec0da3c82fb9861d50187cb6a2a4a97..fa3fd075f2e8aa4eb9171f7a5b9d3fb6e6807a49 100755 (executable)
@@ -142,23 +142,21 @@ if (!exists $::FORM{'target_milestone'}) {
     $::FORM{'target_milestone'} = FetchOneColumn();
 }
 
-if ( Param("strictvaluechecks") ) {
-    GetVersionTable();  
-    CheckFormField(\%::FORM, 'product', \@::legal_product);
-    CheckFormField(\%::FORM, 'version', \@{$::versions{$::FORM{'product'}}});
-    CheckFormField(\%::FORM, 'target_milestone',
-                   \@{$::target_milestone{$::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');
-}
+GetVersionTable();
+CheckFormField(\%::FORM, 'product', \@::legal_product);
+CheckFormField(\%::FORM, 'version', \@{$::versions{$::FORM{'product'}}});
+CheckFormField(\%::FORM, 'target_milestone',
+               \@{$::target_milestone{$::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 @used_fields;
 foreach my $f (@bug_fields) {
index dcde93035916e7dbc1c0b0a7cca36e2b83294eeb..15daf152b117b86fb634b3c7f00058d53c4150bb 100755 (executable)
@@ -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?</P>
     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 "<TABLE BORDER=1><TD><H2>Duplicate notation added to bug $duplicate</H2>\n";
         system("./processmail", $duplicate, $::COOKIE{'Bugzilla_login'});
index 3795c98ea29cb026fe4b562c3aff9f8965a84909..3149d07b7ab51b09759e232452f82fe99c0edb8f 100755 (executable)
--- a/query.cgi
+++ b/query.cgi
@@ -31,8 +31,7 @@ require "CGI.pl";
 
 # Prevents &make_options in CGI.pl from throwing an error if we give it
 # an invalid list of selections (from a remembered query containing values
-# that no longer exist). We don't want to die in the query page even if
-# strict value checks are turned on.
+# that no longer exist), since we don't want to die in the query page.
 $::CheckOptionValues = 0;
 
 use vars