MDL-39810 Files: IE doesn't recognize JSON MIME Type (RFC4627).

Affected versions:
- IE 8+, under Compatibility View.
This commit is contained in:
Matteo Scaramuccia
2013-10-28 23:34:35 +01:00
parent 4daa024fd4
commit bc242bbda5
3 changed files with 105 additions and 11 deletions
+6
View File
@@ -3485,6 +3485,12 @@ class core_renderer_ajax extends core_renderer {
// unfortunately YUI iframe upload does not support application/json
if (!empty($_FILES)) {
@header('Content-type: text/plain; charset=utf-8');
if (!core_useragent::supports_json_contenttype()) {
@header('X-Content-Type-Options: nosniff');
}
} else if (!core_useragent::supports_json_contenttype()) {
@header('Content-type: text/plain; charset=utf-8');
@header('X-Content-Type-Options: nosniff');
} else {
@header('Content-type: application/json; charset=utf-8');
}