]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Fixes #2740 - exception messages using the value for minimum username and password...
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>
Sat, 1 Jan 2011 02:24:01 +0000 (02:24 +0000)
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>
Sat, 1 Jan 2011 02:24:01 +0000 (02:24 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@7800 36083f99-b078-4883-b0ff-0f9b5a30f544

engine/lib/users.php
languages/en.php

index 04e1eeff458acaa1052c9a257ab8d970483d651a..dcdad31931b0fac8e83d15512c580831127c5e4f 100644 (file)
@@ -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;
index 94bf38c2a19401f12fbb9358495ed884141b6669..42776cb3fa1f17b88356e22905e411ef738b1dc1 100644 (file)
@@ -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',