same as previous, but for mime_to_ext

This commit is contained in:
Mikael Nordfeldth 2016-01-12 13:14:17 +01:00
parent dbe5d72e4c
commit 8c28e54ccc
1 changed files with 3 additions and 0 deletions

View File

@ -1871,6 +1871,9 @@ function common_supported_ext_to_mime($fileext)
function common_supported_mime_to_ext($mimetype)
{
$supported = common_config('attachments', 'supported');
if ($supported === true) {
throw new ServerException('Supported mimetype but unknown extension relation.');
}
foreach($supported as $type => $ext) {
if ($mimetype === $type) {
return $ext;