Page MenuHomePhabricator

Error uploading XML files: "This file contains HTML or script code that may be erroneously interpreted by a web browser."
Open, Needs TriagePublic

Description

I tried to upload a number of XML files to one of my private wikis (MW 1.28) but every attempt is frustrated by the following error message:

This file contains HTML or script code that may be erroneously interpreted by a web browser.

The XML files are perfectly valid - and I tried some random ones, too - so I don't know what it's complaining about.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Its an intentional check. IE6 will execute the file as if its html with javascript if any of the tags are htmlish (<head>, <title>, etc)

Work around is to but about 255 bytes of whitespace near the beggining of the file, e.g. between the xml prolog and the root element or have an xml comment thats 255 bytes long.

Aklapper renamed this task from Uploading XML files broken? to Error uploading XML files: "This file contains HTML or script code that may be erroneously interpreted by a web browser.".Dec 28 2017, 6:56 AM

Thanks @Bawolff for the explanation as well as the workaround - hardly something I would have thought of!

I guess I'll have to rethink my strategies.

Theres definitely an argument to be made for removingthe check. IE6 is super old. Some research needs to be done for if it affects other browsers though