- #27694: Correct username validation.
parent
fe0a55d29b
commit
df69978f7f
|
@ -210,7 +210,7 @@ function user_save($account, $array = array(), $category = 'account') {
|
|||
* Verify the syntax of the given name.
|
||||
*/
|
||||
function user_validate_name($name) {
|
||||
if (!$name) return t('You must enter a username.');
|
||||
if (!strlen($name)) return t('You must enter a username.');
|
||||
if (substr($name, 0, 1) == ' ') return t('The username cannot begin with a space.');
|
||||
if (substr($name, -1) == ' ') return t('The username cannot end with a space.');
|
||||
if (ereg(' ', $name)) return t('The username cannot contain multiple spaces in a row.');
|
||||
|
|
Loading…
Reference in New Issue