aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions_upload.php
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/includes/functions_upload.php')
-rw-r--r--phpBB/includes/functions_upload.php12
1 files changed, 4 insertions, 8 deletions
diff --git a/phpBB/includes/functions_upload.php b/phpBB/includes/functions_upload.php
index 46449ff722..8b67769847 100644
--- a/phpBB/includes/functions_upload.php
+++ b/phpBB/includes/functions_upload.php
@@ -169,19 +169,15 @@ class filespec
*/
function get_mimetype($filename)
{
+ $mimetype = '';
+
if (function_exists('mime_content_type'))
{
$mimetype = mime_content_type($filename);
}
- else
- {
- $mimetype = 'application/octetstream';
- }
-
- // Opera adds the name to the mime type
- $mimetype = (strpos($mimetype, '; name') !== false) ? str_replace(strstr($mimetype, '; name'), '', $mimetype) : $mimetype;
- if (!$mimetype)
+ // Some browsers choke on a mimetype of application/octet-stream
+ if (!$mimetype || $mimetype == 'application/octet-stream')
{
$mimetype = 'application/octetstream';
}