Modify configuration to have an option to allow uploads regardless of mime type

This commit is contained in:
Craig Andrews 2010-03-01 19:56:16 -05:00
parent 1b1dab206f
commit f9dd83caa7
2 changed files with 3 additions and 1 deletions

View File

@ -275,6 +275,8 @@ $config['sphinx']['port'] = 3312;
// Support for file uploads (attachments),
// select supported mimetypes and quotas (in bytes)
// $config['attachments']['supported'] = array('image/png', 'application/ogg');
// $config['attachments']['supported'] = true; //allow all file types to be uploaded
// $config['attachments']['file_quota'] = 5000000;
// $config['attachments']['user_quota'] = 50000000;
// $config['attachments']['monthly_quota'] = 15000000;

View File

@ -262,7 +262,7 @@ class MediaFile
$filetype = MIME_Type::autoDetect($stream['uri']);
}
if (in_array($filetype, common_config('attachments', 'supported'))) {
if (common_config('attachments', 'supported') === true || in_array($filetype, common_config('attachments', 'supported'))) {
return $filetype;
}
$media = MIME_Type::getMedia($filetype);