r21762 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r21761‎ | r21762 | r21763 >
Date:17:52, 1 May 2007
Author:hashar
Status:old
Tags:
Comment:
Fix backtrace when creating an account with a password being the same as the
username (r21640, bug 3348).
Modified paths:
  • /trunk/phase3/includes/SpecialUserlogin.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/SpecialUserlogin.php
@@ -228,6 +228,7 @@
229229 return false;
230230 }
231231
 232+ # Check anonymous user ($wgUser) limitations :
232233 if (!$wgUser->isAllowedToCreateAccount()) {
233234 $this->userNotPrivilegedMessage();
234235 return false;
@@ -241,6 +242,7 @@
242243 return;
243244 }
244245
 246+ # Now create a dummy user ($u) and check if it is valid
245247 $name = trim( $this->mName );
246248 $u = User::newFromName( $name, 'creatable' );
247249 if ( is_null( $u ) ) {
@@ -258,7 +260,7 @@
259261 return false;
260262 }
261263
262 - if ( !$wgUser->isValidPassword( $this->mPassword ) ) {
 264+ if ( !$u->isValidPassword( $this->mPassword ) ) {
263265 $this->mainLoginForm( wfMsg( 'passwordtooshort', $wgMinimalPasswordLength ) );
264266 return false;
265267 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r21769Merge from trunk:...brion20:06, 1 May 2007
r36573Implement Extension:PasswordStrength (solves bug 3348)demon14:50, 23 June 2008

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r21640* (bug 3348) Some additional weak password checks: password which is same as ...brion21:45, 26 April 2007