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';
|
require_once 'MIME/Type/Extension.php';
|
||||||
$mte = new MIME_Type_Extension();
|
$mte = new MIME_Type_Extension();
|
||||||
|
try {
|
||||||
$ext = $mte->getExtension($mimetype);
|
$ext = $mte->getExtension($mimetype);
|
||||||
|
} catch ( Exception $e) {
|
||||||
|
$ext = strtolower(preg_replace('/\W/', '', $mimetype));
|
||||||
|
}
|
||||||
$nickname = $profile->nickname;
|
$nickname = $profile->nickname;
|
||||||
$datestamp = strftime('%Y%m%dT%H%M%S', time());
|
$datestamp = strftime('%Y%m%dT%H%M%S', time());
|
||||||
$random = strtolower(common_confirmation_code(32));
|
$random = strtolower(common_confirmation_code(32));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user