diff options
Diffstat (limited to 'classes')
-rw-r--r-- | classes/File.php | 8 | ||||
-rw-r--r-- | classes/User.php | 1 | ||||
-rw-r--r-- | classes/User_group.php | 2 |
3 files changed, 9 insertions, 2 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; } } } diff --git a/classes/User.php b/classes/User.php index 57d76731b..357c1e501 100644 --- a/classes/User.php +++ b/classes/User.php @@ -206,6 +206,7 @@ class User extends Memcached_DataObject if(! User::allowed_nickname($nickname)){ common_log(LOG_WARNING, sprintf("Attempted to register a nickname that is not allowed: %s", $profile->nickname), __FILE__); + return false; } $profile->profileurl = common_profile_url($nickname); diff --git a/classes/User_group.php b/classes/User_group.php index 64fe024b3..e92887474 100644 --- a/classes/User_group.php +++ b/classes/User_group.php @@ -464,7 +464,7 @@ class User_group extends Memcached_DataObject $result = $group->update($orig); if (!$result) { common_log_db_error($group, 'UPDATE', __FILE__); - throw new ServerException(_('Could not set group uri.')); + throw new ServerException(_('Could not set group URI.')); } } |