aboutsummaryrefslogtreecommitdiffstats
path: root/attachment.cgi
diff options
context:
space:
mode:
authormkanat%bugzilla.org <>2008-01-06 08:59:42 +0000
committermkanat%bugzilla.org <>2008-01-06 08:59:42 +0000
commit6896e961efd997683992e547853b91e739ee6bc5 (patch)
treed1266853516b6cfa845ad3e40deaeeffb272c82d /attachment.cgi
parent45c7f0a197c573f3aadc4152f421406f9bd16025 (diff)
downloadbugs-6896e961efd997683992e547853b91e739ee6bc5.tar
bugs-6896e961efd997683992e547853b91e739ee6bc5.tar.gz
bugs-6896e961efd997683992e547853b91e739ee6bc5.tar.bz2
bugs-6896e961efd997683992e547853b91e739ee6bc5.tar.xz
bugs-6896e961efd997683992e547853b91e739ee6bc5.zip
Bug 408446: Non-text attachments were mangled by "binmode STDOUT, ':utf8'"
Patch By Max Kanat-Alexander <mkanat@bugzilla.org> r=LpSolit, a=mkanat
Diffstat (limited to 'attachment.cgi')
-rwxr-xr-xattachment.cgi3
1 files changed, 3 insertions, 0 deletions
diff --git a/attachment.cgi b/attachment.cgi
index 768653c31..6fd238c2f 100755
--- a/attachment.cgi
+++ b/attachment.cgi
@@ -246,6 +246,9 @@ sub view {
print $cgi->header(-type=>"$contenttype; name=\"$filename\"",
-content_disposition=> "inline; filename=\"$filename\"",
-content_length => $attachment->datasize);
+ if (Bugzilla->params->{'utf8'}) {
+ binmode STDOUT, ':raw'; # Turn off UTF8 encoding.
+ }
print $attachment->data;
}