diff options
Diffstat (limited to 'classes')
-rw-r--r-- | classes/File.php | 6 | ||||
-rw-r--r-- | classes/Group_alias.php | 2 | ||||
-rw-r--r-- | classes/User.php | 1 | ||||
-rw-r--r-- | classes/User_group.php | 2 | ||||
-rw-r--r-- | classes/User_username.php | 2 |
5 files changed, 9 insertions, 4 deletions
diff --git a/classes/File.php b/classes/File.php index ba8332841..8c788c007 100644 --- a/classes/File.php +++ b/classes/File.php @@ -194,7 +194,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/Group_alias.php b/classes/Group_alias.php index be3d0a6c6..c5a1895a1 100644 --- a/classes/Group_alias.php +++ b/classes/Group_alias.php @@ -34,7 +34,7 @@ class Group_alias extends Memcached_DataObject public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP /* Static get */ - function staticGet($k,$v=NULL) { return DB_DataObject::staticGet('Group_alias',$k,$v); } + function staticGet($k,$v=NULL) { return Memcached_DataObject::staticGet('Group_alias',$k,$v); } /* the code above is auto generated do not remove the tag below */ ###END_AUTOCODE diff --git a/classes/User.php b/classes/User.php index 330da039b..77091fad5 100644 --- a/classes/User.php +++ b/classes/User.php @@ -211,6 +211,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.')); } } diff --git a/classes/User_username.php b/classes/User_username.php index 853fd5cb8..8d99cddd3 100644 --- a/classes/User_username.php +++ b/classes/User_username.php @@ -55,7 +55,7 @@ class User_username extends Memcached_DataObject // now define the keys. function keys() { - return array('provider_name', 'username'); + return array('provider_name' => 'K', 'username' => 'K'); } } |