commit:     5b3ece55946468a5571fd4c7309480aac267a6a9
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Dec  1 12:07:57 2018 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sat Dec  1 12:08:19 2018 +0000
URL:        
https://gitweb.gentoo.org/proj/gentoo-bugzilla.git/commit/?id=5b3ece55

attachment: Force utf-8 if no charset is explicitly specified

Signed-off-by: Michał Górny <mgorny <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\"",

Reply via email to