aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2018-12-01 13:07:57 +0100
committerMichał Górny <mgorny@gentoo.org>2018-12-01 13:08:19 +0100
commit5b3ece55946468a5571fd4c7309480aac267a6a9 (patch)
tree23fe1848441dd58d71714ed71e4bc0d9b47f5c74 /attachment.cgi
parentAdd notification about GLEP 76 and some more attachment tips (diff)
downloadbugzilla-5b3ece55946468a5571fd4c7309480aac267a6a9.tar.gz
bugzilla-5b3ece55946468a5571fd4c7309480aac267a6a9.tar.bz2
bugzilla-5b3ece55946468a5571fd4c7309480aac267a6a9.zip
attachment: Force utf-8 if no charset is explicitly specified
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'attachment.cgi')
-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\"",