aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2018-12-01 13:07:57 +0100
committerRobin H. Johnson <robbat2@gentoo.org>2019-07-22 22:57:24 -0700
commitd5fb1483cc3b05aff17804a57cd05e5882fc34ae (patch)
tree0ecc558a7f1c9df0a7d154e257cdbe063076fd30
parentAdd Privacy policy link to bugzilla Footer. (diff)
downloadbugzilla-d5fb1483cc3b05aff17804a57cd05e5882fc34ae.tar.gz
bugzilla-d5fb1483cc3b05aff17804a57cd05e5882fc34ae.tar.bz2
bugzilla-d5fb1483cc3b05aff17804a57cd05e5882fc34ae.zip
attachment: Force utf-8 if no charset is explicitly specifiedgentoo-5.0.4.9
Signed-off-by: Michał Górny <mgorny@gentoo.org> (cherry picked from commit 5b3ece55946468a5571fd4c7309480aac267a6a9) Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
-rwxr-xr-xattachment.cgi8
1 files changed, 1 insertions, 7 deletions
diff --git a/attachment.cgi b/attachment.cgi
index 2f04e9594..3f0ff22ba 100755
--- a/attachment.cgi
+++ b/attachment.cgi
@@ -355,13 +355,7 @@ sub view {
if ($contenttype !~ /\bcharset=/i) {
# In order to prevent Apache from adding a charset, we have to send a
# charset that's a single space.
- $cgi->charset(' ');
- if (Bugzilla->feature('detect_charset') && $contenttype =~ /^text\//) {
- my $encoding = detect_encoding($attachment->data);
- if ($encoding) {
- $cgi->charset(find_encoding($encoding)->mime_name);
- }
- }
+ $cgi->charset('UTF-8');
}
print $cgi->header(-type=>"$contenttype; name=\"$filename\"",
-content_disposition=> "$disposition; filename=\"$filename\"",