We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit 464e0f81 authored by Brion Vibber's avatar Brion Vibber

Don't trust text/xml mime types; generic content detection gives useless stuff...

Don't trust text/xml mime types; generic content detection gives useless stuff like that on SVG images! Todo: replace the extension check in this case with better content-based checks.
parent 35d9a065
......@@ -362,7 +362,9 @@ class MediaFile
// we'll try detecting a type from its extension...
$unclearTypes = array('application/octet-stream',
'application/vnd.ms-office',
'application/zip');
'application/zip',
// TODO: for XML we could do better content-based sniffing too
'text/xml');
if ($originalFilename && (!$filetype || in_array($filetype, $unclearTypes))) {
$type = $mte->getMIMEType($originalFilename);
......
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