summaryrefslogtreecommitdiff
path: root/classes/File.php
diff options
context:
space:
mode:
Diffstat (limited to 'classes/File.php')
-rw-r--r--classes/File.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/classes/File.php b/classes/File.php
index 91b12d2e2..79a7d6681 100644
--- a/classes/File.php
+++ b/classes/File.php
@@ -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));
@@ -279,6 +283,8 @@ class File extends Memcached_DataObject
if($oembed->modified) $enclosure->modified=$oembed->modified;
unset($oembed->size);
}
+ } else {
+ return false;
}
}
}