diff options
author | mkanat%bugzilla.org <> | 2006-09-06 03:54:05 +0200 |
---|---|---|
committer | mkanat%bugzilla.org <> | 2006-09-06 03:54:05 +0200 |
commit | 971d73458f19eb7d1a3600ee7bfd11b16cbc698a (patch) | |
tree | f820db2b83adbe975dfa9b15b53067ce6fec29df /Bugzilla | |
parent | 7c689d36de8bff9692abf67b2cfb0cacdca85016 (diff) | |
download | bugzilla-971d73458f19eb7d1a3600ee7bfd11b16cbc698a.tar.gz bugzilla-971d73458f19eb7d1a3600ee7bfd11b16cbc698a.tar.xz |
Bug 349764: Errors print out a whole HTML page, even when we're not in USAGE_MODE_BROWSER
Patch By Max Kanat-Alexander <mkanat@bugzilla.org> r=kevin.benton, a=myk
Diffstat (limited to 'Bugzilla')
-rw-r--r-- | Bugzilla/CGI.pm | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/Bugzilla/CGI.pm b/Bugzilla/CGI.pm index 39c812551..b78c077e9 100644 --- a/Bugzilla/CGI.pm +++ b/Bugzilla/CGI.pm @@ -37,6 +37,7 @@ use CGI qw(-no_xhtml -oldstyle_urls :private_tempfiles :unique_headers SERVER_PU use base qw(CGI); +use Bugzilla::Constants; use Bugzilla::Error; use Bugzilla::Util; @@ -61,10 +62,12 @@ 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); + if (Bugzilla->error_mode eq ERROR_MODE_WEBPAGE) { + # 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} = []; |