jenkins-bot has submitted this change and it was merged.

Change subject: Simplify checks on Special:UserLogin/signup
......................................................................


Simplify checks on Special:UserLogin/signup

I27c488e4008a924117ff6bac2216f148cd5e7abd changed the validation code in
User::getCanonicalName, the # and Title::makeTitleSafe checks now done
there and can be removed here.

Follow-Up: I27c488e4008a924117ff6bac2216f148cd5e7abd
Follow-Up: I88c479cea2bc9d2eab882e0ee8ebcbe2d1dd125e
Follow-Up: I983e3f528491817f9f31f71a92d8d2946ce5941d
Change-Id: I17bf88be6398dc402295264ca9bfd57809c872d7
---
M includes/specials/SpecialUserlogin.php
1 file changed, 1 insertion(+), 13 deletions(-)

Approvals:
  Reedy: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/specials/SpecialUserlogin.php 
b/includes/specials/SpecialUserlogin.php
index b6a3be2..2eefd0a 100644
--- a/includes/specials/SpecialUserlogin.php
+++ b/includes/specials/SpecialUserlogin.php
@@ -527,20 +527,8 @@
                        return Status::newFatal( 'sorbs_create_account_reason' 
);
                }
 
-               // Normalize the name so that silly things don't cause "invalid 
username"
-               // errors. User::newFromName does some rather strict checking, 
rejecting
-               // e.g. leading/trailing/multiple spaces. But first we need to 
reject
-               // usernames that would be treated as titles with a fragment 
part.
-               if ( strpos( $this->mUsername, '#' ) !== false ) {
-                       return Status::newFatal( 'noname' );
-               }
-               $title = Title::makeTitleSafe( NS_USER, $this->mUsername );
-               if ( !is_object( $title ) ) {
-                       return Status::newFatal( 'noname' );
-               }
-
                # Now create a dummy user ($u) and check if it is valid
-               $u = User::newFromName( $title->getText(), 'creatable' );
+               $u = User::newFromName( $this->mUsername, 'creatable' );
                if ( !is_object( $u ) ) {
                        return Status::newFatal( 'noname' );
                } elseif ( 0 != $u->idForName() ) {

-- 
To view, visit https://gerrit.wikimedia.org/r/156155
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I17bf88be6398dc402295264ca9bfd57809c872d7
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Umherirrender <umherirrender_de...@web.de>
Gerrit-Reviewer: CSteipp <cste...@wikimedia.org>
Gerrit-Reviewer: Reedy <re...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to