зеркало из https://github.com/mozilla/pjs.git
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
This commit is contained in:
Родитель
dcef1afa27
Коммит
2fb7d9553f
|
@ -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} = [];
|
||||
|
|
|
@ -393,11 +393,9 @@
|
|||
[% END %]
|
||||
[% END %]
|
||||
|
||||
[%# If we are in ERROR_MODE_DIE, we want the error message to be plain text,
|
||||
# not HTML
|
||||
%]
|
||||
[%# We only want HTML error messages for ERROR_MODE_WEBPAGE %]
|
||||
[% USE Bugzilla %]
|
||||
[% IF Bugzilla.error_mode == ERROR_MODE_DIE %]
|
||||
[% IF Bugzilla.error_mode != ERROR_MODE_WEBPAGE %]
|
||||
[% error_message FILTER none %]
|
||||
[% RETURN %]
|
||||
[% END %]
|
||||
|
|
|
@ -1475,11 +1475,9 @@
|
|||
[% END %]
|
||||
[% END %]
|
||||
|
||||
[%# If we are in ERROR_MODE_DIE, we want the error message to be plain text,
|
||||
# not HTML
|
||||
%]
|
||||
[%# We only want HTML error messages for ERROR_MODE_WEBPAGE %]
|
||||
[% USE Bugzilla %]
|
||||
[% IF Bugzilla.error_mode == ERROR_MODE_DIE %]
|
||||
[% IF Bugzilla.error_mode != ERROR_MODE_WEBPAGE %]
|
||||
[% error_message FILTER none %]
|
||||
[% RETURN %]
|
||||
[% END %]
|
||||
|
|
Загрузка…
Ссылка в новой задаче