Interface Fix: too short username are forbidden during registration
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@236 b3834d28-1941-0410-a4f8-b48e95affb8f
This commit is contained in:
parent
8e9d354af1
commit
004add5e82
2 changed files with 4 additions and 2 deletions
|
@ -49,7 +49,7 @@ if (POST_SUBMITTED != '') {
|
|||
|
||||
// Check if username is valid (length, authorized characters)
|
||||
} elseif (!$userservice->isValidUsername($posteduser)) {
|
||||
$tplVars['error'] = T_('This username is not valid (too long, forbidden characters...), please make another choice.');
|
||||
$tplVars['error'] = T_('This username is not valid (too short, too long, forbidden characters...), please make another choice.');
|
||||
|
||||
// Check if e-mail address is valid
|
||||
} elseif (!$userservice->isValidEmail(POST_MAIL)) {
|
||||
|
|
|
@ -445,7 +445,9 @@ class UserService {
|
|||
}
|
||||
|
||||
function isValidUsername($username) {
|
||||
if (strlen($username) > 24) {
|
||||
if (strlen($username) < 4) {
|
||||
return false;
|
||||
}elseif (strlen($username) > 24) {
|
||||
// too long usernames are cut by database and may cause bugs when compared
|
||||
return false;
|
||||
} elseif (preg_match('/(\W)/', $username) > 0) {
|
||||
|
|
Loading…
Reference in a new issue