summaryrefslogtreecommitdiff
path: root/actions/register.php
diff options
context:
space:
mode:
authorBrion Vibber <brion@pobox.com>2010-11-29 14:15:25 -0800
committerBrion Vibber <brion@pobox.com>2010-11-29 14:15:25 -0800
commitdc350b5463e7d64a46d7f90143c2d001be99e280 (patch)
treebdf19094f16b2cfd35dac1ef309954e89ac3494b /actions/register.php
parent6e249b4ab5aa292d78cfaa9be9dce8706e27ad80 (diff)
Work in progress on nickname validation changes. lib/nickname.php appears to have been destroyed by NetBeans and will be rewritten shortly. Sigh.
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 3ae3f56f6..5d91aef70 100644
--- a/actions/register.php
+++ b/actions/register.php
@@ -198,7 +198,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')) {
@@ -206,11 +210,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)) {