1 |
commit: 5b3ece55946468a5571fd4c7309480aac267a6a9 |
2 |
Author: Michał Górny <mgorny <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Dec 1 12:07:57 2018 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Dec 1 12:08:19 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/gentoo-bugzilla.git/commit/?id=5b3ece55 |
7 |
|
8 |
attachment: Force utf-8 if no charset is explicitly specified |
9 |
|
10 |
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org> |
11 |
|
12 |
attachment.cgi | 8 +------- |
13 |
1 file changed, 1 insertion(+), 7 deletions(-) |
14 |
|
15 |
diff --git a/attachment.cgi b/attachment.cgi |
16 |
index 2f04e9594..3f0ff22ba 100755 |
17 |
--- a/attachment.cgi |
18 |
+++ b/attachment.cgi |
19 |
@@ -355,13 +355,7 @@ sub view { |
20 |
if ($contenttype !~ /\bcharset=/i) { |
21 |
# In order to prevent Apache from adding a charset, we have to send a |
22 |
# charset that's a single space. |
23 |
- $cgi->charset(' '); |
24 |
- if (Bugzilla->feature('detect_charset') && $contenttype =~ /^text\//) { |
25 |
- my $encoding = detect_encoding($attachment->data); |
26 |
- if ($encoding) { |
27 |
- $cgi->charset(find_encoding($encoding)->mime_name); |
28 |
- } |
29 |
- } |
30 |
+ $cgi->charset('UTF-8'); |
31 |
} |
32 |
print $cgi->header(-type=>"$contenttype; name=\"$filename\"", |
33 |
-content_disposition=> "$disposition; filename=\"$filename\"", |