diff options
author | Siebrand Mazeland <s.mazeland@xs4all.nl> | 2010-03-02 19:13:51 +0100 |
---|---|---|
committer | Siebrand Mazeland <s.mazeland@xs4all.nl> | 2010-03-02 19:13:51 +0100 |
commit | f65478b624f485098eb1675572357af2f3ca5c40 (patch) | |
tree | f2b49854daaa7db9ce531c012d694977ee7b4315 /classes | |
parent | 767d49495d900979b9e694eed51e0379c529181c (diff) | |
parent | 68347691b0c7fb3f81415abd7fcdc5aec85cc554 (diff) |
Merge branch '0.9.x' of git://gitorious.org/statusnet/mainline into 0.9.x
Diffstat (limited to 'classes')
-rw-r--r-- | classes/File.php | 6 |
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)); |