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.

This commit is contained in:
Brion Vibber 2010-12-22 13:56:19 -08:00
parent 35d9a065fb
commit 464e0f8115
1 changed files with 3 additions and 1 deletions

View File

@ -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);