summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormkanat%bugzilla.org <>2008-01-06 09:59:42 +0100
committermkanat%bugzilla.org <>2008-01-06 09:59:42 +0100
commit6896e961efd997683992e547853b91e739ee6bc5 (patch)
treed1266853516b6cfa845ad3e40deaeeffb272c82d
parent45c7f0a197c573f3aadc4152f421406f9bd16025 (diff)
downloadbugzilla-6896e961efd997683992e547853b91e739ee6bc5.tar.gz
bugzilla-6896e961efd997683992e547853b91e739ee6bc5.tar.xz
Bug 408446: Non-text attachments were mangled by "binmode STDOUT, ':utf8'"
Patch By Max Kanat-Alexander <mkanat@bugzilla.org> r=LpSolit, a=mkanat
-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;
}