]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 340253: .cgi scripts should call Throw*Error() instead of die() - Patch by Frédér...
authorlpsolit%gmail.com <>
Sun, 4 Jun 2006 02:53:59 +0000 (02:53 +0000)
committerlpsolit%gmail.com <>
Sun, 4 Jun 2006 02:53:59 +0000 (02:53 +0000)
process_bug.cgi
reports.cgi
template/en/default/global/code-error.html.tmpl
template/en/default/global/user-error.html.tmpl

index a8a0f5f0dc5f3ba7b5c6f565beb239ade9e64898..726b78942ca0dea03ca646710bd3d6f1cff390a7 100755 (executable)
@@ -1789,8 +1789,7 @@ foreach my $id (@idlist) {
                     shift @oldlist;
                 } else {
                     if ($oldlist[0] != $newlist[0]) {
-                        $dbh->bz_unlock_tables(UNLOCK_ABORT);
-                        die "Error in list comparing code";
+                        ThrowCodeError('list_comparison_error');
                     }
                     shift @oldlist;
                     shift @newlist;
index 5553f2c9766b98973f5c2cd12f25c22b6908d1a2..731618c0fe4491f23f43a7d0ee0f2055d880997d 100755 (executable)
@@ -233,7 +233,8 @@ sub chart_image_name {
     # and number
 
     if ($datasets !~ m/^[A-Za-z0-9:]+$/) {
-        die "Invalid datasets $datasets";
+        $vars->{'datasets'} = $datasets;
+        ThrowUserError('invalid_datasets', $vars);
     }
 
     # Since we pass the tests, consider it OK
index 141930b07195de98493a5916fb083d1a9647a072..2a8ea1c0eb6dba91259f5439dff4affeedc96c33 100644 (file)
     [% title = "Invalid Series" %]
     The series_id [% series_id FILTER html %] is not valid. It may be that
     this series has been deleted.
-    
+
+  [% ELSIF error == "list_comparison_error" %]
+    Unexpected error in list comparing code.
+
   [% ELSIF error == "mismatched_bug_ids_on_obsolete" %]
     Attachment [% attach_id FILTER html %] ([% description FILTER html %]) 
     is attached to [% terms.bug %] [%+ attach_bug_id FILTER html %], 
index d0f105ef759165022c6b8db63ef864fd8e439662..3de6bc74e11c95f91551f1c0237605241391e943 100644 (file)
     The context [% context FILTER html %] is invalid (must be a number,
     "file" or "patch").
 
+  [% ELSIF error == "invalid_datasets" %]
+    [% title = "Invalid Datasets" %]
+    Invalid datasets <em>[% datasets FILTER html %]</em>. Only digits,
+    letters and colons are allowed.
+
   [% ELSIF error == "invalid_format" %]
     [% title = "Invalid Format" %]
     The format "[% format FILTER html %]" is invalid (must be one of