Index: trunk/extensions/PasswordStrength/PasswordStrength.php |
— | — | @@ -47,34 +47,34 @@ |
48 | 48 | * strength tests |
49 | 49 | */ |
50 | 50 | function psCheckRegex( $user, $newpass, $status ) { |
51 | | - global $wgPasswordStrengthCheck; |
| 51 | + global $wgPasswordStrengthCheck, $wgLang; |
52 | 52 | if ( $status != 'success' ) { // skip earlier checks |
53 | 53 | return true; |
54 | 54 | } |
55 | 55 | wfLoadExtensionMessages( 'PasswordStrength' ); |
56 | | - |
| 56 | + |
57 | 57 | if ( $wgMustHaveInts > 0 ) { |
58 | 58 | preg_match_all( "/[0-9]/", $newpass, $matches ); |
59 | 59 | if ( (count($matches) - 1) < $wgMustHaveInts ) { |
60 | | - $result = wfMsgExt( 'passwordstr-needmore-ints', array( 'parsemag'), $wgMustHaveInts ); |
| 60 | + $result = wfMsgExt( 'passwordstr-needmore-ints', array( 'parsemag' ), $wgLang->formatNum( $wgMustHaveInts ) ); |
61 | 61 | throw new PasswordError( $result ); |
62 | 62 | } |
63 | 63 | } |
64 | 64 | if ( $wgMustHaveUpperCase > 0 ) { |
65 | 65 | preg_match_all( "/[A-Z]/", $newpass, $matches ); |
66 | 66 | if ( (count($matches) - 1) < $wgMustHaveUpperCase ) { |
67 | | - $result = wfMsgExt( 'passwordstr-needmore-upper', array( 'parsemag'), $wgMustHaveUpperCase ); |
| 67 | + $result = wfMsgExt( 'passwordstr-needmore-upper', array( 'parsemag' ), $wgLang->formatNum( $wgMustHaveUpperCase ) ); |
68 | 68 | throw new PasswordError( $result ); |
69 | 69 | } |
70 | 70 | } |
71 | 71 | if ( $wgMustHaveLowerCase > 0 ) { |
72 | 72 | preg_match_all( "/[a-z]/", $newpass, $matches ); |
73 | 73 | if ( (count($matches) - 1) < $wgMustHaveLowerCase ) { |
74 | | - $result = wfMsgExt( 'passwordstr-needmore-lower', array( 'parsemag'), $wgMustHaveLowerCase ); |
| 74 | + $result = wfMsgExt( 'passwordstr-needmore-lower', array( 'parsemag' ), $wgLang->formatNum( $wgMustHaveLowerCase ) ); |
75 | 75 | throw new PasswordError( $result ); |
76 | 76 | } |
77 | 77 | } |
78 | | - |
| 78 | + |
79 | 79 | if ( is_array( $wgPasswordStrengthCheck ) ) { |
80 | 80 | foreach ( $wgPasswordStrengthCheck as $regex ) { |
81 | 81 | if ( preg_match( $regex, $password ) ) { |