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

Change subject: (bug 45012) Do not show a "badretype" error when creating an 
account by e-mail.
......................................................................


(bug 45012) Do not show a "badretype" error when creating an account by e-mail.

Change-Id: Idd1ffaef60dc2ab2498a3dabe2902051aea990d2
---
M RELEASE-NOTES-1.21
M includes/specials/SpecialUserlogin.php
2 files changed, 14 insertions(+), 10 deletions(-)

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



diff --git a/RELEASE-NOTES-1.21 b/RELEASE-NOTES-1.21
index 2eca857..34030be 100644
--- a/RELEASE-NOTES-1.21
+++ b/RELEASE-NOTES-1.21
@@ -171,6 +171,8 @@
 * (bug 44775) The username field is not pre-filled when creating an account.
 * (bug 45069) wfParseUrl() no longer produces a PHP notice if passed a 
"mailto:";
   URL without address
+* (bug 45012) Creating an account by e-mail can no longer show a
+  "password mismatch" error.
 
 === API changes in 1.21 ===
 * prop=revisions can now report the contentmodel and contentformat.
diff --git a/includes/specials/SpecialUserlogin.php 
b/includes/specials/SpecialUserlogin.php
index 78383bd..27701d4 100644
--- a/includes/specials/SpecialUserlogin.php
+++ b/includes/specials/SpecialUserlogin.php
@@ -373,22 +373,24 @@
                        return Status::newFatal( 'noname' );
                } elseif ( 0 != $u->idForName() ) {
                        return Status::newFatal( 'userexists' );
-               } elseif ( 0 != strcmp( $this->mPassword, $this->mRetype ) ) {
-                       return Status::newFatal( 'badretype' );
                }
 
-               # check for minimal password length
-               $valid = $u->getPasswordValidity( $this->mPassword );
-               if ( $valid !== true ) {
-                       if ( !$this->mCreateaccountMail ) {
+               if ( $this->mCreateaccountMail ) {
+                       # do not force a password for account creation by email
+                       # set invalid password, it will be replaced later by a 
random generated password
+                       $this->mPassword = null;
+               } else {
+                       if ( $this->mPassword !== $this->mRetype ) {
+                               return Status::newFatal( 'badretype' );
+                       }
+
+                       # check for minimal password length
+                       $valid = $u->getPasswordValidity( $this->mPassword );
+                       if ( $valid !== true ) {
                                if ( !is_array( $valid ) ) {
                                        $valid = array( $valid, 
$wgMinimalPasswordLength );
                                }
                                return call_user_func_array( 
'Status::newFatal', $valid );
-                       } else {
-                               # do not force a password for account creation 
by email
-                               # set invalid password, it will be replaced 
later by a random generated password
-                               $this->mPassword = null;
                        }
                }
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Idd1ffaef60dc2ab2498a3dabe2902051aea990d2
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: IAlex <ialex.w...@gmail.com>
Gerrit-Reviewer: Aaron Schulz <asch...@wikimedia.org>
Gerrit-Reviewer: Parent5446 <tylerro...@gmail.com>
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