commit: d5fb1483cc3b05aff17804a57cd05e5882fc34ae Author: Michał Górny <mgorny <AT> gentoo <DOT> org> AuthorDate: Sat Dec 1 12:07:57 2018 +0000 Commit: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org> CommitDate: Tue Jul 23 05:57:24 2019 +0000 URL: https://gitweb.gentoo.org/proj/gentoo-bugzilla.git/commit/?id=d5fb1483
attachment: Force utf-8 if no charset is explicitly specified Signed-off-by: Michał Górny <mgorny <AT> gentoo.org> (cherry picked from commit 5b3ece55946468a5571fd4c7309480aac267a6a9) Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org> attachment.cgi | 8 +------- 1 file changed, 1 insertion(+), 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\"",