]> 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:22:03 +0000 (06:22 +0000)
committermkanat%bugzilla.org <>
Wed, 26 Jul 2006 06:22:03 +0000 (06:22 +0000)
Patch By Max Kanat-Alexander <mkanat@bugzilla.org> r=LpSolit, a=myk

Bugzilla/Bug.pm
Bugzilla/CGI.pm

index ba69932e90d9b9ed84b51b7f39dd1ae36488f433..60e9cb1f82639da70dcd5e1806ebcadd1d9ca81f 100755 (executable)
@@ -30,8 +30,6 @@ package Bugzilla::Bug;
 
 use strict;
 
-use CGI::Carp qw(fatalsToBrowser);
-
 use Bugzilla::Attachment;
 use Bugzilla::Constants;
 use Bugzilla::Field;
index dd6061346c03da174e28da75b008ce36bceda6da..51c26347228bf71af68384456d808e659c36d04d 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;
@@ -62,6 +61,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} = [];