r47567 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r47566‎ | r47567 | r47568 >
Date:18:02, 20 February 2009
Author:raymond
Status:ok
Tags:
Comment:
formatNum for numbers
Modified paths:
  • /trunk/extensions/PasswordStrength/PasswordStrength.php (modified) (history)

Diff [purge]

Index: trunk/extensions/PasswordStrength/PasswordStrength.php
@@ -47,34 +47,34 @@
4848 * strength tests
4949 */
5050 function psCheckRegex( $user, $newpass, $status ) {
51 - global $wgPasswordStrengthCheck;
 51+ global $wgPasswordStrengthCheck, $wgLang;
5252 if ( $status != 'success' ) { // skip earlier checks
5353 return true;
5454 }
5555 wfLoadExtensionMessages( 'PasswordStrength' );
56 -
 56+
5757 if ( $wgMustHaveInts > 0 ) {
5858 preg_match_all( "/[0-9]/", $newpass, $matches );
5959 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 ) );
6161 throw new PasswordError( $result );
6262 }
6363 }
6464 if ( $wgMustHaveUpperCase > 0 ) {
6565 preg_match_all( "/[A-Z]/", $newpass, $matches );
6666 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 ) );
6868 throw new PasswordError( $result );
6969 }
7070 }
7171 if ( $wgMustHaveLowerCase > 0 ) {
7272 preg_match_all( "/[a-z]/", $newpass, $matches );
7373 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 ) );
7575 throw new PasswordError( $result );
7676 }
7777 }
78 -
 78+
7979 if ( is_array( $wgPasswordStrengthCheck ) ) {
8080 foreach ( $wgPasswordStrengthCheck as $regex ) {
8181 if ( preg_match( $regex, $password ) ) {

Status & tagging log