diff options
author | Steven Wittens <steven@10.no-reply.drupal.org> | 2005-07-29 07:18:36 +0000 |
---|---|---|
committer | Steven Wittens <steven@10.no-reply.drupal.org> | 2005-07-29 07:18:36 +0000 |
commit | 8de43c320ab0b729ed1b3ee60ad6b03fe6653b12 (patch) | |
tree | 846f3c8d0b707febb44b24c00a35d0b87d54132a | |
parent | f99176c9a06cc905c6ef71598ba052928b741678 (diff) | |
download | brdo-8de43c320ab0b729ed1b3ee60ad6b03fe6653b12.tar.gz brdo-8de43c320ab0b729ed1b3ee60ad6b03fe6653b12.tar.bz2 |
- #27694: Correct username validation.
-rw-r--r-- | modules/user.module | 2 | ||||
-rw-r--r-- | modules/user/user.module | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/modules/user.module b/modules/user.module index ff4666cef..192b497e7 100644 --- a/modules/user.module +++ b/modules/user.module @@ -209,7 +209,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.'); diff --git a/modules/user/user.module b/modules/user/user.module index ff4666cef..192b497e7 100644 --- a/modules/user/user.module +++ b/modules/user/user.module @@ -209,7 +209,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.'); |