r61916 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r61915‎ | r61916 | r61917 >
Date:07:39, 3 February 2010
Author:tstarling
Status:ok
Tags:
Comment:
Revert r58025 (User::newFromName() returns WikiError under certain circumstances). Incomplete, breaks lots of things, see CR.
Modified paths:
  • /trunk/phase3/includes/User.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialUserlogin.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/User.php
@@ -354,9 +354,7 @@
355355 $validate = 'valid';
356356 }
357357 $name = self::getCanonicalName( $name, $validate );
358 - if ( WikiError::isError( $name ) ) {
359 - return $name;
360 - } elseif ( $name === false ) {
 358+ if ( $name === false ) {
361359 return false;
362360 } else {
363361 # Create unloaded user object
@@ -701,7 +699,7 @@
702700 # with title normalisation, but then it's too late to
703701 # check elsewhere
704702 if( strpos( $name, '#' ) !== false )
705 - return new WikiError( 'usernamehasherror' );
 703+ return false;
706704
707705 # Clean up name according to title rules
708706 $t = ( $validate === 'valid' ) ?
Index: trunk/phase3/includes/specials/SpecialUserlogin.php
@@ -265,11 +265,6 @@
266266 # Now create a dummy user ($u) and check if it is valid
267267 $name = trim( $this->mName );
268268 $u = User::newFromName( $name, 'creatable' );
269 - if ( WikiError::isError( $u ) ) {
270 - $this->mainLoginForm( wfMsg( $u->getMessage() ) );
271 - return false;
272 - }
273 -
274269 if ( !is_object( $u ) ) {
275270 $this->mainLoginForm( wfMsg( 'noname' ) );
276271 return false;

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r58025more specific error message, using WikiError, if user trys to create account ...aude16:54, 22 October 2009

Status & tagging log