Commit 9417cb6b authored by Côme Chilliet's avatar Côme Chilliet
Browse files

Merge branch '5989-do-not-set-charset-when-content-type-is-not-text-in-http-headers' into '1.4-dev'

Resolve "Do not set charset when content-type is not text/* in HTTP headers"

See merge request fusiondirectory/fd!588
Showing with 3 additions and 1 deletion
+3 -1
......@@ -230,8 +230,10 @@ class Language
if (!headers_sent()) {
header("Content-Language: $lang".(empty($country) ? '' : "-$country"));
if (!empty($char)) {
if (!empty($char) && preg_match('|^text/|', $mime)) {
header("Content-Type: $mime; charset=$char");
} else {
header("Content-Type: $mime");
}
} else {
trigger_error('Could not set language '.$lang.' header, headers already sent');
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment