summaryrefslogtreecommitdiff
path: root/actions/profilesettings.php
diff options
context:
space:
mode:
authorBrion Vibber <brion@pobox.com>2010-11-29 16:47:51 -0800
committerBrion Vibber <brion@pobox.com>2010-11-29 16:47:51 -0800
commit8161bf079758f5a07549081c24a5e68ec66113b6 (patch)
tree99973c28b101a294936886ac612d72fef9ba2229 /actions/profilesettings.php
parentf1f67c2af542aabea4e93d7df0d2e917658e6a83 (diff)
parent3be352551a979cc3e89e0a2b8f950949b932a304 (diff)
Merge branch 'namecase' into 0.9.x
Diffstat (limited to 'actions/profilesettings.php')
-rw-r--r--actions/profilesettings.php16
1 files changed, 8 insertions, 8 deletions
diff --git a/actions/profilesettings.php b/actions/profilesettings.php
index e1a0f8b6d..28b1d20f3 100644
--- a/actions/profilesettings.php
+++ b/actions/profilesettings.php
@@ -225,7 +225,13 @@ class ProfilesettingsAction extends AccountSettingsAction
if (Event::handle('StartProfileSaveForm', array($this))) {
- $nickname = $this->trimmed('nickname');
+ try {
+ $nickname = Nickname::normalize($this->trimmed('nickname'));
+ } catch (NicknameException $e) {
+ $this->showForm($e->getMessage());
+ return;
+ }
+
$fullname = $this->trimmed('fullname');
$homepage = $this->trimmed('homepage');
$bio = $this->trimmed('bio');
@@ -236,13 +242,7 @@ class ProfilesettingsAction extends AccountSettingsAction
$tagstring = $this->trimmed('tags');
// Some validation
- if (!Validate::string($nickname, array('min_length' => 1,
- 'max_length' => 64,
- 'format' => NICKNAME_FMT))) {
- // TRANS: Validation error in form for profile settings.
- $this->showForm(_('Nickname must have only lowercase letters and numbers and no spaces.'));
- return;
- } else if (!User::allowed_nickname($nickname)) {
+ if (!User::allowed_nickname($nickname)) {
// TRANS: Validation error in form for profile settings.
$this->showForm(_('Not a valid nickname.'));
return;