summaryrefslogtreecommitdiff
path: root/plugins/OpenID/finishopenidlogin.php
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/OpenID/finishopenidlogin.php')
-rw-r--r--plugins/OpenID/finishopenidlogin.php15
1 files changed, 5 insertions, 10 deletions
diff --git a/plugins/OpenID/finishopenidlogin.php b/plugins/OpenID/finishopenidlogin.php
index 01dd61edb..86dd1c669 100644
--- a/plugins/OpenID/finishopenidlogin.php
+++ b/plugins/OpenID/finishopenidlogin.php
@@ -272,13 +272,10 @@ class FinishopenidloginAction extends Action
}
}
- $nickname = $this->trimmed('newname');
-
- if (!Validate::string($nickname, array('min_length' => 1,
- 'max_length' => 64,
- 'format' => NICKNAME_FMT))) {
- // TRANS: OpenID plugin message. The entered new user name did not conform to the requirements.
- $this->showForm(_m('Nickname must have only lowercase letters and numbers and no spaces.'));
+ try {
+ $nickname = Nickname::validate($this->trimmed('newname'));
+ } catch (NicknameException $e) {
+ $this->showForm($e->getMessage());
return;
}
@@ -463,9 +460,7 @@ class FinishopenidloginAction extends Action
function isNewNickname($str)
{
- if (!Validate::string($str, array('min_length' => 1,
- 'max_length' => 64,
- 'format' => NICKNAME_FMT))) {
+ if (!Nickname::isValid($str)) {
return false;
}
if (!User::allowed_nickname($str)) {