From b8af0a52b1e403fefb5675ae420733304284da5d Mon Sep 17 00:00:00 2001 From: cash Date: Sat, 1 Jan 2011 02:24:01 +0000 Subject: 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 --- engine/lib/users.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'engine') 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; -- cgit v1.2.3