LoginForm: Pass username as first parameter to error message if aborted
authorKunal Mehta <legoktm@gmail.com>
Tue, 10 Jun 2014 22:00:08 +0000 (15:00 -0700)
committerKunal Mehta <legoktm@gmail.com>
Tue, 10 Jun 2014 22:00:08 +0000 (15:00 -0700)
If a hook is aborted, pass the username as the first parameter to allow
for more customized messages.

Change-Id: Ifb55a2e180c619f7d06f728dd8eea2c9863b8f82

includes/specials/SpecialUserlogin.php

index bee94f8..dcc87a0 100644 (file)
@@ -929,7 +929,8 @@ class LoginForm extends SpecialPage {
                                break;
                        case self::ABORTED:
                                $error = $this->mAbortLoginErrorMsg ?: 'login-abort-generic';
-                               $this->mainLoginForm( $this->msg( $error )->text() );
+                               $this->mainLoginForm( $this->msg( $error,
+                                               wfEscapeWikiText( $this->mUsername ) )->text() );
                                break;
                        default:
                                throw new MWException( 'Unhandled case value' );