From: mkanat%bugzilla.org <> Date: Wed, 26 Jul 2006 06:23:49 +0000 (+0000) Subject: Bug 300978: bad output when a non-cgi script dies X-Git-Tag: bugzilla-2.22.1~36 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0055ee0ba447a1678c0bf15e87be521d6eb5a67a;p=thirdparty%2Fbugzilla.git Bug 300978: bad output when a non-cgi script dies Patch By Max Kanat-Alexander r=LpSolit, a=myk --- diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm index 3d64623679..14024c2d9d 100755 --- a/Bugzilla/Bug.pm +++ b/Bugzilla/Bug.pm @@ -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; diff --git a/Bugzilla/CGI.pm b/Bugzilla/CGI.pm index e267fd9141..b84f18da62 100644 --- a/Bugzilla/CGI.pm +++ b/Bugzilla/CGI.pm @@ -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} = [];