summaryrefslogtreecommitdiff
path: root/classes/File.php
diff options
context:
space:
mode:
authorBrion Vibber <brion@pobox.com>2010-03-02 15:16:48 -0800
committerBrion Vibber <brion@pobox.com>2010-03-02 15:16:48 -0800
commit8e06b932af93b8fbd66610c948bdde4fafd4f300 (patch)
tree07b772b280e6f23761c0111d953b3c2f5b8d2120 /classes/File.php
parent453ad6a9964fe572f0f35821e3f78c6a77c57c49 (diff)
parentddf3614c843bcd8d9ecfd0850ac9a8cefae6dbba (diff)
Merge branch '0.9.x' of git@gitorious.org:statusnet/mainline into 0.9.x
Diffstat (limited to 'classes/File.php')
-rw-r--r--classes/File.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/classes/File.php b/classes/File.php
index 189e04ce0..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));