summaryrefslogtreecommitdiff
path: root/actions/register.php
diff options
context:
space:
mode:
authorBrion Vibber <brion@pobox.com>2010-12-07 10:50:05 -0800
committerBrion Vibber <brion@pobox.com>2010-12-07 10:50:05 -0800
commit9df856e667a12cd217576263efbc72fff12692d9 (patch)
treedc8d588e8b01d1ec788c78d6aec10a9b9d26bec6 /actions/register.php
parent01f32e3998b8d031d2a39e2d0506253142b6632e (diff)
parent4b4b763255ad3b2bff8f18da2bd3927b52a54e55 (diff)
Merge branch '0.9.x' into merge
Conflicts: README actions/hostmeta.php classes/File_redirection.php lib/common.php lib/designsettings.php lib/router.php lib/util.php lib/xmppmanager.php plugins/OStatus/OStatusPlugin.php
Diffstat (limited to 'actions/register.php')
-rw-r--r--actions/register.php11
1 files changed, 5 insertions, 6 deletions
diff --git a/actions/register.php b/actions/register.php
index a600dfe44..075b1af99 100644
--- a/actions/register.php
+++ b/actions/register.php
@@ -191,7 +191,11 @@ class RegisterAction extends Action
}
// Input scrubbing
- $nickname = common_canonical_nickname($nickname);
+ try {
+ $nickname = Nickname::normalize($nickname);
+ } catch (NicknameException $e) {
+ $this->showForm($e->getMessage());
+ }
$email = common_canonical_email($email);
if (!$this->boolean('license')) {
@@ -199,11 +203,6 @@ class RegisterAction extends Action
'agree to the license.'));
} else if ($email && !Validate::email($email, common_config('email', 'check_domain'))) {
$this->showForm(_('Not a valid email address.'));
- } else if (!Validate::string($nickname, array('min_length' => 1,
- 'max_length' => 64,
- 'format' => NICKNAME_FMT))) {
- $this->showForm(_('Nickname must have only lowercase letters '.
- 'and numbers and no spaces.'));
} else if ($this->nicknameExists($nickname)) {
$this->showForm(_('Nickname already in use. Try another one.'));
} else if (!User::allowed_nickname($nickname)) {