summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Bugzilla/CGI.pm15
-rw-r--r--Bugzilla/Error.pm4
-rwxr-xr-xbuglist.cgi21
3 files changed, 19 insertions, 21 deletions
diff --git a/Bugzilla/CGI.pm b/Bugzilla/CGI.pm
index 0adb46a62..a12fb284b 100644
--- a/Bugzilla/CGI.pm
+++ b/Bugzilla/CGI.pm
@@ -310,9 +310,24 @@ sub multipart_start {
$headers .= "Set-Cookie: ${cookie}${CGI::CRLF}";
}
$headers .= $CGI::CRLF;
+ $self->{_multipart_in_progress} = 1;
return $headers;
}
+sub close_standby_message {
+ my ($self, $contenttype, $disposition) = @_;
+
+ if ($self->{_multipart_in_progress}) {
+ print $self->multipart_end();
+ print $self->multipart_start(-type => $contenttype,
+ -content_disposition => $disposition);
+ }
+ else {
+ print $self->header(-type => $contenttype,
+ -content_disposition => $disposition);
+ }
+}
+
# Override header so we can add the cookies in
sub header {
my $self = shift;
diff --git a/Bugzilla/Error.pm b/Bugzilla/Error.pm
index 41345e11b..6e3309778 100644
--- a/Bugzilla/Error.pm
+++ b/Bugzilla/Error.pm
@@ -117,9 +117,11 @@ sub _throw_error {
$vars->{maintainers_notified} = 0;
}
- print Bugzilla->cgi->header();
+ my $cgi = Bugzilla->cgi;
+ $cgi->close_standby_message('text/html', 'inline');
$template->process($name, $vars)
|| ThrowTemplateError($template->error());
+ print $cgi->multipart_final() if $cgi->{_multipart_in_progress};
if ($vars->{maintainers_notified}) {
sentry_handle_error($vars->{error}, $vars->{processed}->{error_message});
diff --git a/buglist.cgi b/buglist.cgi
index 57b906949..d6875f5fe 100755
--- a/buglist.cgi
+++ b/buglist.cgi
@@ -316,22 +316,6 @@ sub GetGroups {
return [values %legal_groups];
}
-sub _close_standby_message {
- my ($contenttype, $disp, $disp_prefix, $extension, $serverpush) = @_;
- my $cgi = Bugzilla->cgi;
- $cgi->set_dated_content_disp($disp, $disp_prefix, $extension);
-
- # Close the "please wait" page, then open the buglist page
- if ($serverpush) {
- print $cgi->multipart_end();
- print $cgi->multipart_start(-type => $contenttype);
- }
- else {
- print $cgi->header($contenttype);
- }
-}
-
-
################################################################################
# Command Execution
################################################################################
@@ -1008,8 +992,6 @@ if ($one_product && $user->can_enter_product($one_product)) {
# The following variables are used when the user is making changes to multiple bugs.
if ($dotweak && scalar @bugs) {
if (!$vars->{'caneditbugs'}) {
- _close_standby_message('text/html',
- 'inline', "error", "html", $serverpush);
ThrowUserError('auth_failure', {group => 'editbugs',
action => 'modify',
object => 'multiple_bugs'});
@@ -1116,8 +1098,7 @@ if ($format->{'extension'} eq "csv") {
$vars->{'human'} = $cgi->param('human');
}
-_close_standby_message($contenttype, $disposition, $disp_prefix,
- $format->{'extension'}, $serverpush);
+$cgi->close_standby_message($contenttype, $disposition);
################################################################################
# Content Generation