Merge "Fix edit link for messages in $wgForceUIMsgAsContentMsg"
[lhc/web/wiklou.git] / includes / specials / SpecialUserlogin.php
index d6634a8..64a6f72 100644 (file)
@@ -194,13 +194,13 @@ class LoginForm extends SpecialPage {
                        && in_array( $entryError->getKey(), self::getValidErrorMessages() )
                ) {
                        $this->mEntryErrorType = 'error';
-                       $this->mEntryError = $entryError->rawParams( $loginreqlink )->escaped();
+                       $this->mEntryError = $entryError->rawParams( $loginreqlink )->parse();
 
                } elseif ( $entryWarning->exists()
                        && in_array( $entryWarning->getKey(), self::getValidErrorMessages() )
                ) {
                        $this->mEntryErrorType = 'warning';
-                       $this->mEntryError = $entryWarning->rawParams( $loginreqlink )->escaped();
+                       $this->mEntryError = $entryWarning->rawParams( $loginreqlink )->parse();
                }
 
                if ( $wgEnableEmail ) {
@@ -710,7 +710,11 @@ class LoginForm extends SpecialPage {
                }
 
                $u = User::newFromName( $this->mUsername );
+               if ( $u === false ) {
+                       return self::ILLEGAL;
+               }
 
+               $msg = null;
                // Give extensions a way to indicate the username has been updated,
                // rather than telling the user the account doesn't exist.
                if ( !Hooks::run( 'LoginUserMigrated', array( $u, &$msg ) ) ) {
@@ -718,7 +722,7 @@ class LoginForm extends SpecialPage {
                        return self::USER_MIGRATED;
                }
 
-               if ( !( $u instanceof User ) || !User::isUsableName( $u->getName() ) ) {
+               if ( !User::isUsableName( $u->getName() ) ) {
                        return self::ILLEGAL;
                }
 
@@ -736,7 +740,6 @@ class LoginForm extends SpecialPage {
 
                // Give general extensions, such as a captcha, a chance to abort logins
                $abort = self::ABORTED;
-               $msg = null;
                if ( !Hooks::run( 'AbortLogin', array( $u, $this->mPassword, &$abort, &$msg ) ) ) {
                        $this->mAbortLoginErrorMsg = $msg;
 
@@ -762,7 +765,7 @@ class LoginForm extends SpecialPage {
                                // As a side-effect, we can authenticate the user's e-mail ad-
                                // dress if it's not already done, since the temporary password
                                // was sent via e-mail.
-                               if ( !$u->isEmailConfirmed() ) {
+                               if ( !$u->isEmailConfirmed() && !wfReadOnly() ) {
                                        $u->confirmEmail();
                                        $u->saveSettings();
                                }