SpecialChangeEmail: error if old email was entered in new email field
[lhc/web/wiklou.git] / includes / specials / SpecialChangeEmail.php
index babb315..22df04e 100644 (file)
@@ -107,7 +107,7 @@ class SpecialChangeEmail extends FormSpecialPage {
        }
 
        protected function getDisplayFormat() {
-               return 'vform';
+               return 'ooui';
        }
 
        protected function alterForm( HTMLForm $form ) {
@@ -160,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();