windows seems to use applicaton/msword for rtf-documents, instead of application/rtf, we now list files with both mime type, if the extension is .rtf

This commit is contained in:
Ralf Becker 2007-07-09 13:29:09 +00:00
parent db1951fc81
commit 760eb2af1a

View File

@ -1909,7 +1909,9 @@ $readonlys['button[vcard]'] = true;
foreach($files as $file)
{
// return only the mime-types we support
if ($file['mime_type'] != 'application/rtf' && substr($file['mime_type'],0,5) != 'text/') continue;
if (!($file['mime_type'] == 'application/rtf' ||
$file['mime_type'] == 'application/msword' && !strcasecmp(substr($file['name'],-4),'.rtf') ||
substr($file['mime_type'],0,5) == 'text/')) continue;
// As browsers not always return the right mime_type, you could use a negative list instead
//if ($file['mime_type'] == 'Directory' || substr($file['mime_type'],0,6) == 'image/') continue;