summaryrefslogtreecommitdiff
path: root/classes
diff options
context:
space:
mode:
Diffstat (limited to 'classes')
-rw-r--r--classes/File.php6
-rw-r--r--classes/User.php1
-rw-r--r--classes/User_group.php2
3 files changed, 7 insertions, 2 deletions
diff --git a/classes/File.php b/classes/File.php
index 1b8ef1b3e..4ecd3b959 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));
diff --git a/classes/User.php b/classes/User.php
index aa9fbf948..fade0f35d 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 0460c9870..7be55163a 100644
--- a/classes/User_group.php
+++ b/classes/User_group.php
@@ -483,7 +483,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.'));
}
}