diff options
author | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-01-01 02:24:01 +0000 |
---|---|---|
committer | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-01-01 02:24:01 +0000 |
commit | b8af0a52b1e403fefb5675ae420733304284da5d (patch) | |
tree | c85fa6c8a62590520ef44971fcb5ceeb3bbde6b5 /engine/lib/users.php | |
parent | e3a44b04c90097e587f9e127e9c8440db405ce22 (diff) | |
download | elgg-b8af0a52b1e403fefb5675ae420733304284da5d.tar.gz elgg-b8af0a52b1e403fefb5675ae420733304284da5d.tar.bz2 |
Fixes #2740 - exception messages using the value for minimum username and password length
git-svn-id: http://code.elgg.org/elgg/trunk@7800 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib/users.php')
-rw-r--r-- | engine/lib/users.php | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/engine/lib/users.php b/engine/lib/users.php index 04e1eeff4..dcdad3193 100644 --- a/engine/lib/users.php +++ b/engine/lib/users.php @@ -1026,7 +1026,8 @@ function validate_username($username) { } if (strlen($username) < $CONFIG->minusername) { - throw new RegistrationException(elgg_echo('registration:usernametooshort')); + $msg = elgg_echo('registration:usernametooshort', array($CONFIG->minusername)); + throw new RegistrationException($msg); } // Blacklist for bad characters (partially nicked from mediawiki) @@ -1072,8 +1073,13 @@ function validate_username($username) { function validate_password($password) { global $CONFIG; + if (!isset($CONFIG->min_password_length)) { + $CONFIG->min_password_length = 6; + } + if (strlen($password) < $CONFIG->min_password_length) { - throw new RegistrationException(elgg_echo('registration:passwordtooshort')); + $msg = elgg_echo('registration:passwordtooshort', array($CONFIG->min_password_length)); + throw new RegistrationException($msg); } $result = true; |