IAlex has uploaded a new change for review.
https://gerrit.wikimedia.org/r/49617
Change subject: (bug 45012) Do not show a "badretype" error of creating an
account by e-mail
......................................................................
(bug 45012) Do not show a "badretype" error of 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(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core
refs/changes/17/49617/1
diff --git a/RELEASE-NOTES-1.21 b/RELEASE-NOTES-1.21
index 7e06218..eaba740 100644
--- a/RELEASE-NOTES-1.21
+++ b/RELEASE-NOTES-1.21
@@ -169,6 +169,8 @@
* (bug 43964) Invalid value of "link" parameter in <gallery> no longer produces
a fatal error.
* (bug 44775) The username field is not pre-filled when creating an account.
+* (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: newchange
Gerrit-Change-Id: Idd1ffaef60dc2ab2498a3dabe2902051aea990d2
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: IAlex <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits