canonicalization lowercases nicknames

darcs-hash:20080611141824-84dde-a1016e113f7ba0e32685d935cd57618c60db2265.gz
This commit is contained in:
Evan Prodromou 2008-06-11 10:18:24 -04:00
parent 02e2dfd1aa
commit 64b5b1902c
2 changed files with 2 additions and 2 deletions

View File

@ -54,7 +54,7 @@ class RegisterAction extends Action {
} else if (!Validate::string($nickname, array('min_length' => 1, } else if (!Validate::string($nickname, array('min_length' => 1,
'max_length' => 64, 'max_length' => 64,
'format' => VALIDATE_NUM . VALIDATE_ALPHA_LOWER))) { 'format' => VALIDATE_NUM . VALIDATE_ALPHA_LOWER))) {
$this->show_form(_t('Nickname must have only letters and numbers and no spaces.')); $this->show_form(_t('Nickname must have only lowercase letters and numbers and no spaces.'));
} else if ($this->nickname_exists($nickname)) { } else if ($this->nickname_exists($nickname)) {
$this->show_form(_t('Nickname already exists.')); $this->show_form(_t('Nickname already exists.'));
} else if ($this->email_exists($email)) { } else if ($this->email_exists($email)) {

View File

@ -385,7 +385,7 @@ function common_current_user() {
# get canonical version of nickname for comparison # get canonical version of nickname for comparison
function common_canonical_nickname($nickname) { function common_canonical_nickname($nickname) {
# XXX: UTF-8 canonicalization (like combining chars) # XXX: UTF-8 canonicalization (like combining chars)
return $nickname; return strtolower($nickname);
} }
# get canonical version of email for comparison # get canonical version of email for comparison