From 5dd32479fff6aadafbbccb6251b5b5cc0506121f Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Wed, 3 Feb 2010 07:39:32 +0000 Subject: [PATCH] Revert r58025 (User::newFromName() returns WikiError under certain circumstances). Incomplete, breaks lots of things, see CR. --- includes/User.php | 6 ++---- includes/specials/SpecialUserlogin.php | 5 ----- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/includes/User.php b/includes/User.php index 67fb66a5d9..ee148b0bc5 100644 --- a/includes/User.php +++ b/includes/User.php @@ -354,9 +354,7 @@ class User { $validate = 'valid'; } $name = self::getCanonicalName( $name, $validate ); - if ( WikiError::isError( $name ) ) { - return $name; - } elseif ( $name === false ) { + if ( $name === false ) { return false; } else { # Create unloaded user object @@ -701,7 +699,7 @@ class User { # with title normalisation, but then it's too late to # check elsewhere if( strpos( $name, '#' ) !== false ) - return new WikiError( 'usernamehasherror' ); + return false; # Clean up name according to title rules $t = ( $validate === 'valid' ) ? diff --git a/includes/specials/SpecialUserlogin.php b/includes/specials/SpecialUserlogin.php index b20f3561bd..823173e64b 100644 --- a/includes/specials/SpecialUserlogin.php +++ b/includes/specials/SpecialUserlogin.php @@ -265,11 +265,6 @@ class LoginForm { # Now create a dummy user ($u) and check if it is valid $name = trim( $this->mName ); $u = User::newFromName( $name, 'creatable' ); - if ( WikiError::isError( $u ) ) { - $this->mainLoginForm( wfMsg( $u->getMessage() ) ); - return false; - } - if ( !is_object( $u ) ) { $this->mainLoginForm( wfMsg( 'noname' ) ); return false; -- 2.20.1