]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 300978: bad output when a non-cgi script dies
authormkanat%bugzilla.org <>
Wed, 26 Jul 2006 06:23:49 +0000 (06:23 +0000)
committermkanat%bugzilla.org <>
Wed, 26 Jul 2006 06:23:49 +0000 (06:23 +0000)
Patch By Max Kanat-Alexander <mkanat@bugzilla.org> r=LpSolit, a=myk

Bugzilla/Bug.pm
Bugzilla/CGI.pm

index 3d64623679dc8d59abc36d2701c706d40cef45f1..14024c2d9d272de730cfa1418ee22cd1e8b5ead3 100755 (executable)
@@ -35,8 +35,6 @@ use vars qw($legal_keywords @legal_platform
             @settable_resolution %components %versions %target_milestone
             @enterable_products %milestoneurl %prodmaxvotes);
 
-use CGI::Carp qw(fatalsToBrowser);
-
 use Bugzilla::Attachment;
 use Bugzilla::BugMail;
 use Bugzilla::Config;
index e267fd91414786dd7366eed1c818de6a548744b1..b84f18da62812f97dabfb0f44775f2f20015519e 100644 (file)
@@ -36,7 +36,6 @@ BEGIN {
 use CGI qw(-no_xhtml -oldstyle_urls :private_tempfiles :unique_headers SERVER_PUSH);
 
 use base qw(CGI);
-use CGI::Carp qw(fatalsToBrowser);
 
 use Bugzilla::Error;
 use Bugzilla::Util;
@@ -57,6 +56,11 @@ sub new {
 
     my $self = $class->SUPER::new(@args);
 
+    # This happens here so that command-line scripts don't spit out
+    # their errors in HTML format.
+    require CGI::Carp;
+    import CGI::Carp qw(fatalsToBrowser);
+
     # Make sure our outgoing cookie list is empty on each invocation
     $self->{Bugzilla_cookie_list} = [];