We only allow (and have) MIME types in supported list

$config['attachment']['supported'] may not use only the file extension.
This commit is contained in:
Mikael Nordfeldth 2014-03-08 02:02:26 +01:00
parent 6f6065e5e9
commit 0eb38b8f84

View File

@ -325,15 +325,6 @@ class MediaFile
} }
$supported = common_config('attachments', 'supported'); $supported = common_config('attachments', 'supported');
if (is_array($supported)) {
// Normalize extensions to mime types
foreach ($supported as $i => $entry) {
if (strpos($entry, '/') === false) {
common_log(LOG_INFO, "sample.$entry");
$supported[$i] = $mte->getMIMEType("sample.$entry");
}
}
}
if ($supported === true || in_array($filetype, $supported)) { if ($supported === true || in_array($filetype, $supported)) {
// Restore PEAR error handlers for our DB code... // Restore PEAR error handlers for our DB code...
$_PEAR->staticPopErrorHandling(); $_PEAR->staticPopErrorHandling();