Merge "Unsetting the email address for a user when the email address is invalidated."
[lhc/web/wiklou.git] / includes / User.php
index 2aabf24..bc06f97 100644 (file)
@@ -38,14 +38,6 @@ define( 'MW_USER_VERSION', 10 );
  */
 define( 'EDIT_TOKEN_SUFFIX', '+\\' );
 
-/**
- * Thrown by User::setPassword() on error.
- * @ingroup Exception
- */
-class PasswordError extends MWException {
-       // NOP
-}
-
 /**
  * The User object encapsulates all of the user-specific settings (user_id,
  * name, rights, password, email address, options, last login time). Client
@@ -2420,8 +2412,8 @@ class User implements IDBAccessObject {
                if ( $str == $this->mEmail ) {
                        return;
                }
-               $this->mEmail = $str;
                $this->invalidateEmail();
+               $this->mEmail = $str;
                wfRunHooks( 'UserSetEmail', array( $this, &$this->mEmail ) );
        }
 
@@ -4071,6 +4063,7 @@ class User implements IDBAccessObject {
                $this->mEmailToken = null;
                $this->mEmailTokenExpires = null;
                $this->setEmailAuthenticationTimestamp( null );
+               $this->mEmail = '';
                wfRunHooks( 'InvalidateEmailComplete', array( $this ) );
                return true;
        }