From: Brion Vibber Date: Wed, 22 Dec 2010 21:56:19 +0000 (-0800) Subject: Don't trust text/xml mime types; generic content detection gives useless stuff like... X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=464e0f8115e3b5b01b6110ddc7a73274164c8584;p=quix0rs-gnu-social.git 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. --- diff --git a/lib/mediafile.php b/lib/mediafile.php index a41d7c76b5..caa902de5d 100644 --- a/lib/mediafile.php +++ b/lib/mediafile.php @@ -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);