aboutsummaryrefslogtreecommitdiffstats
path: root/buglist.cgi
diff options
context:
space:
mode:
authorwurblzap%gmail.com <>2007-06-22 12:29:24 +0000
committerwurblzap%gmail.com <>2007-06-22 12:29:24 +0000
commit8699690c76360c62e748f5557831243322655bfd (patch)
tree7794f17fc1239bc2053929f54f7b24ca5b90c8ee /buglist.cgi
parent1609f8fcf3d9b2b68cc0892e3948402020e4ea09 (diff)
downloadbugs-8699690c76360c62e748f5557831243322655bfd.tar
bugs-8699690c76360c62e748f5557831243322655bfd.tar.gz
bugs-8699690c76360c62e748f5557831243322655bfd.tar.bz2
bugs-8699690c76360c62e748f5557831243322655bfd.tar.xz
bugs-8699690c76360c62e748f5557831243322655bfd.zip
Bug 383745: Incorrect charset specification in "please wait" screen when server push is in use.
Patch by Marc Schumann <wurblzap@gmail.com>, r=mkanat, a=mkanat
Diffstat (limited to 'buglist.cgi')
-rwxr-xr-xbuglist.cgi37
1 files changed, 16 insertions, 21 deletions
diff --git a/buglist.cgi b/buglist.cgi
index 6d47b69f9..6c7f9a451 100755
--- a/buglist.cgi
+++ b/buglist.cgi
@@ -397,6 +397,8 @@ if ($cgi->param('cmdtype') eq "dorem" && $cgi->param('remaction') =~ /^run/) {
# with the HTTP headers.
$filename =~ s/\s/_/g;
}
+$filename =~ s/\\/\\\\/g; # escape backslashes
+$filename =~ s/"/\\"/g; # escape quotes
# Take appropriate action based on user's request.
if ($cgi->param('cmdtype') eq "dorem") {
@@ -957,14 +959,9 @@ if ($cgi->param('debug')) {
# Time to use server push to display an interim message to the user until
# the query completes and we can display the bug list.
-my $disposition = '';
if ($serverpush) {
- $filename =~ s/\\/\\\\/g; # escape backslashes
- $filename =~ s/"/\\"/g; # escape quotes
- $disposition = qq#inline; filename="$filename"#;
-
- print $cgi->multipart_init(-content_disposition => $disposition);
- print $cgi->multipart_start();
+ print $cgi->multipart_init();
+ print $cgi->multipart_start(-type => 'text/html');
# Generate and return the UI (HTML page) from the appropriate template.
$template->process("list/server-push.html.tmpl", $vars)
@@ -1189,7 +1186,7 @@ $vars->{'defaultsavename'} = $cgi->param('query_based_on');
# Generate HTTP headers
my $contenttype;
-my $disp = "inline";
+my $disposition = "inline";
if ($format->{'extension'} eq "html" && !$agent) {
if ($order) {
@@ -1221,23 +1218,21 @@ else {
if ($format->{'extension'} eq "csv") {
# We set CSV files to be downloaded, as they are designed for importing
# into other programs.
- $disp = "attachment";
+ $disposition = "attachment";
}
+# Suggest a name for the bug list if the user wants to save it as a file.
+$disposition .= "; filename=\"$filename\"";
+
if ($serverpush) {
- # close the "please wait" page, then open the buglist page
+ # Close the "please wait" page, then open the buglist page
print $cgi->multipart_end();
- my @extra;
- push @extra, (-charset => "utf8") if Bugzilla->params->{"utf8"};
- print $cgi->multipart_start(-type => $contenttype,
- -content_disposition => $disposition,
- @extra);
-} else {
- # Suggest a name for the bug list if the user wants to save it as a file.
- # If we are doing server push, then we did this already in the HTTP headers
- # that started the server push, so we don't have to do it again here.
- print $cgi->header(-type => $contenttype,
- -content_disposition => "$disp; filename=$filename");
+ print $cgi->multipart_start(-type => $contenttype,
+ -content_disposition => $disposition);
+}
+else {
+ print $cgi->header(-type => $contenttype,
+ -content_disposition => $disposition);
}