diff options
-rw-r--r-- | engine/lib/users.php | 10 | ||||
-rw-r--r-- | languages/en.php | 4 |
2 files changed, 10 insertions, 4 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; diff --git a/languages/en.php b/languages/en.php index 94bf38c2a..42776cb3f 100644 --- a/languages/en.php +++ b/languages/en.php @@ -484,8 +484,8 @@ $english = array( 'registration:notemail' => 'The email address you provided does not appear to be a valid email address.', 'registration:userexists' => 'That username already exists', - 'registration:usernametooshort' => 'Your username must be a minimum of 4 characters long.', - 'registration:passwordtooshort' => 'The password must be a minimum of 6 characters long.', + 'registration:usernametooshort' => 'Your username must be a minimum of %u characters long.', + 'registration:passwordtooshort' => 'The password must be a minimum of %u characters long.', 'registration:dupeemail' => 'This email address has already been registered.', 'registration:invalidchars' => 'Sorry, your username contains the following invalid character: %s. All of these characters are invalid: %s', 'registration:emailnotvalid' => 'Sorry, the email address you entered is invalid on this system', |