diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2015-12-17 09:15:42 +0100 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2015-12-17 09:44:51 +0100 |
commit | a1789ddde42033f1b05cc4929491214ee6e79383 (patch) | |
tree | 63615735c4ddffaaabf2428946bb26f90899f7bf /includes/specials/SpecialChangeEmail.php | |
parent | 9e06a62f265e3a2aaabecc598d4bc617e06fa32d (diff) |
Update to MediaWiki 1.26.0
Diffstat (limited to 'includes/specials/SpecialChangeEmail.php')
-rw-r--r-- | includes/specials/SpecialChangeEmail.php | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/includes/specials/SpecialChangeEmail.php b/includes/specials/SpecialChangeEmail.php index eca307d9..22df04e8 100644 --- a/includes/specials/SpecialChangeEmail.php +++ b/includes/specials/SpecialChangeEmail.php @@ -92,14 +92,14 @@ class SpecialChangeEmail extends FormSpecialPage { 'NewEmail' => array( 'type' => 'email', 'label-message' => 'changeemail-newemail', + 'autofocus' => true ), ); if ( $this->getConfig()->get( 'RequirePasswordforEmailChange' ) ) { $fields['Password'] = array( 'type' => 'password', - 'label-message' => 'changeemail-password', - 'autofocus' => true, + 'label-message' => 'changeemail-password' ); } @@ -107,7 +107,7 @@ class SpecialChangeEmail extends FormSpecialPage { } protected function getDisplayFormat() { - return 'vform'; + return 'ooui'; } protected function alterForm( HTMLForm $form ) { @@ -129,7 +129,8 @@ class SpecialChangeEmail extends FormSpecialPage { public function onSuccess() { $request = $this->getRequest(); - $titleObj = Title::newFromText( $request->getVal( 'returnto' ) ); + $returnto = $request->getVal( 'returnto' ); + $titleObj = $returnto !== null ? Title::newFromText( $returnto ) : null; if ( !$titleObj instanceof Title ) { $titleObj = Title::newMainPage(); } @@ -159,6 +160,10 @@ class SpecialChangeEmail extends FormSpecialPage { return Status::newFatal( 'invalidemailaddress' ); } + if ( $newaddr === $user->getEmail() ) { + return Status::newFatal( 'changeemail-nochange' ); + } + $throttleCount = LoginForm::incLoginThrottle( $user->getName() ); if ( $throttleCount === true ) { $lang = $this->getLanguage(); |