forked from GNUsocial/gnu-social
Correctly handle the case when MIME/Type doesn't know what file extension a mime type maps to
This commit is contained in:
parent
d8212977ce
commit
a0114f2006
@ -169,7 +169,11 @@ class File extends Memcached_DataObject
|
||||
{
|
||||
require_once 'MIME/Type/Extension.php';
|
||||
$mte = new MIME_Type_Extension();
|
||||
$ext = $mte->getExtension($mimetype);
|
||||
try {
|
||||
$ext = $mte->getExtension($mimetype);
|
||||
} catch ( Exception $e) {
|
||||
$ext = strtolower(preg_replace('/\W/', '', $mimetype));
|
||||
}
|
||||
$nickname = $profile->nickname;
|
||||
$datestamp = strftime('%Y%m%dT%H%M%S', time());
|
||||
$random = strtolower(common_confirmation_code(32));
|
||||
|
Loading…
Reference in New Issue
Block a user