}
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)
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;
'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',