r52495 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r52494‎ | r52495 | r52496 >
Date:16:54, 27 June 2009
Author:demon
Status:deferred
Tags:
Comment:
Followup to r52494: Update only extension using isValidPassword in SVN or listed on MW.org. Return string messages instead of false. Still keep custom message thing in place though.
Modified paths:
  • /trunk/extensions/SecurePasswords/SecurePasswords.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SecurePasswords/SecurePasswords.php
@@ -239,37 +239,37 @@
240240
241241 // check password length
242242 if( strlen( $password ) < $wgValidPasswords['minlength'] ) {
243 - $result = false;
 243+ $result = 'securepasswords-valid';
244244 return false;
245245 }
246246
247247 // check for a lowercase letter, if needed
248248 if( $wgValidPasswords['lowercase'] && !preg_match( '/[a-z]/', $password ) ) {
249 - $result = false;
 249+ $result = 'securepasswords-lowercase';
250250 return false;
251251 }
252252
253253 // check for an uppercase letter, if needed
254254 if( $wgValidPasswords['uppercase'] && !preg_match( '/[A-Z]/', $password ) ) {
255 - $result = false;
 255+ $result = 'securepasswords-uppercase';
256256 return false;
257257 }
258258
259259 // check for a digit, if needed
260260 if( $wgValidPasswords['digit'] && !preg_match( '/[0-9]/', $password ) ) {
261 - $result = false;
 261+ $result = 'securepasswords-digit';
262262 return false;
263263 }
264264
265265 // check for a special character, if needed
266266 if( $wgValidPasswords['special'] && !preg_match( '/[' . $wgSecurePasswordsSpecialChars . ']/', $password ) ) {
267 - $result = false;
 267+ $result = 'securepasswords-special';
268268 return false;
269269 }
270270
271271 // check for the username, if needed
272272 if( $wgValidPasswords['usercheck'] && $wgContLang->lc( $password ) == $wgContLang->lc( $user->getName() ) ) {
273 - $result = false;
 273+ $result = 'securepasswords-username';
274274 return false;
275275 }
276276
@@ -278,7 +278,7 @@
279279 $link = pspell_new( $lang );
280280 if( $link ) {
281281 if( pspell_check( $link, $password ) ) {
282 - $result = false;
 282+ $result = 'securepasswords-word';
283283 return false;
284284 }
285285 }
@@ -286,7 +286,7 @@
287287 $link = pspell_new( 'en' );
288288 if( $link ) {
289289 if( pspell_check( $link, $password ) ) {
290 - $result = false;
 290+ $result = 'securepasswords-word';
291291 return false;
292292 }
293293 }

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r52494(bug 19157) createAndPromote error on bad password...demon16:53, 27 June 2009

Status & tagging log