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

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
parents e30c2775 c0724f60
......@@ -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');
Markdown is supported
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