summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDylan William Hardison <dylan@hardison.net>2018-05-22 02:34:29 +0200
committerDylan William Hardison <dylan@hardison.net>2018-06-28 22:41:57 +0200
commitf2f708f6985dd3a7c51869c0dda5791ca239d248 (patch)
tree8750204ea248d89cc004bf74aa0b27e5d6d4e281
parent9c83baadd88c0605dcf663e6a8782ffb5867298d (diff)
downloadbugzilla-f2f708f6985dd3a7c51869c0dda5791ca239d248.tar.gz
bugzilla-f2f708f6985dd3a7c51869c0dda5791ca239d248.tar.xz
good stuff
-rw-r--r--Bugzilla.pm13
-rw-r--r--Bugzilla/CGI.pm12
-rw-r--r--Bugzilla/Quantum/CGI.pm9
-rw-r--r--Bugzilla/WebService/Server/JSONRPC.pm3
4 files changed, 5 insertions, 32 deletions
diff --git a/Bugzilla.pm b/Bugzilla.pm
index c12e24e42..858fa6f44 100644
--- a/Bugzilla.pm
+++ b/Bugzilla.pm
@@ -197,18 +197,7 @@ sub template {
request_cache->{template} //= Bugzilla::Template->create();
request_cache->{template}->{_is_main} = 1;
- if (Bugzilla->cgi->server_software eq 'Bugzilla::Quantum::CGI') {
- return request_cache->{quantum_template} //= do {
- my $template = request_cache->{template};
- my $c = $Bugzilla::C;
- my $q_template = Bugzilla::Quantum::Template->new( controller => $c, template => $template );
- $q_template->{_is_main} = 1;
- $q_template;
- };
- }
- else {
- return request_cache->{template};
- }
+ return request_cache->{template};
}
sub template_inner {
diff --git a/Bugzilla/CGI.pm b/Bugzilla/CGI.pm
index 8fae0c424..99957c59c 100644
--- a/Bugzilla/CGI.pm
+++ b/Bugzilla/CGI.pm
@@ -712,17 +712,7 @@ sub send_cookie {
sub redirect {
my $self = shift;
$self->{bz_redirecting} = 1;
- use Carp;
- carp "redirect @_\n";
- if ($self->server_software eq 'Bugzilla::Quantum::CGI') {
- my $c = $Bugzilla::C;
- $self->SUPER::redirect(@_);
- $c->redirect_to($c->res->headers->location);
- return '';
- }
- else {
- return $self->SUPER::redirect(@_);
- }
+ return $self->SUPER::redirect(@_);
}
# This helps implement Bugzilla::Search::Recent, and also shortens search
diff --git a/Bugzilla/Quantum/CGI.pm b/Bugzilla/Quantum/CGI.pm
index 5ccda4d6f..c0fb04c22 100644
--- a/Bugzilla/Quantum/CGI.pm
+++ b/Bugzilla/Quantum/CGI.pm
@@ -10,6 +10,7 @@ use Mojo::Base 'Mojolicious::Controller';
use CGI::Compile;
use Bugzilla::Constants qw(bz_locations);
+use Bugzilla::Quantum::Stdout;
use File::Slurper qw(read_text);
use File::Spec::Functions qw(catfile);
use Sub::Name;
@@ -60,24 +61,20 @@ sub _load_cgi {
my ($c) = @_;
my $stdin = $c->_STDIN;
my $stdout = '';
- local $Bugzilla::C = $c;
local %ENV = $c->_ENV;
local *STDIN; ## no critic (local)
- local *STDOUT; ## no critic (local)
local $CGI::Compile::USE_REAL_EXIT = 0;
local $PROGRAM_NAME = $file;
open STDIN, '<', $stdin->path or die "STDIN @{[$stdin->path]}: $!" if -s $stdin->path;
- open STDOUT, '>', \$stdout or die "STDOUT capture: $!";
+ tie STDOUT, 'Bugzilla::Quantum::Stdout', controller => $c; ## no critic (tie)
try {
Bugzilla->init_page();
$inner->();
}
catch {
- $c->render(text => $_);
die $_ unless ref $_ eq 'ARRAY' && $_->[0] eq "EXIT\n" || /\bModPerl::Util::exit\b/;
}
finally {
- $c->res->body($stdout) if $stdout;
Bugzilla->_cleanup; ## no critic (private)
CGI::initialize_globals();
};
@@ -146,4 +143,4 @@ sub _STDIN {
return Mojo::Asset::File->new->add_chunk( $stdin->slurp );
}
-1; \ No newline at end of file
+1;
diff --git a/Bugzilla/WebService/Server/JSONRPC.pm b/Bugzilla/WebService/Server/JSONRPC.pm
index 9253053ce..093167048 100644
--- a/Bugzilla/WebService/Server/JSONRPC.pm
+++ b/Bugzilla/WebService/Server/JSONRPC.pm
@@ -112,9 +112,6 @@ sub response {
print $cgi->header(-status => $response->code, @header_args);
print $response->content;
}
- if ($cgi->server_software eq 'Bugzilla::Quantum::CGI') {
- $Bugzilla::C->rendered;
- }
}
# The JSON-RPC 1.1 GET specification is not so great--you can't specify