summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrion Vibber <brion@pobox.com>2010-12-22 13:56:19 -0800
committerBrion Vibber <brion@pobox.com>2010-12-22 13:56:19 -0800
commit464e0f8115e3b5b01b6110ddc7a73274164c8584 (patch)
treeb2a4eaf4fe9e5e0bf547871a522a81da78c76343
parent35d9a065fb0f1ada1a96034d2e5a4076420d4e8a (diff)
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.
-rw-r--r--lib/mediafile.php4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/mediafile.php b/lib/mediafile.php
index a41d7c76b..caa902de5 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);