From 349d80a7d6d47726bc3ae4d20100be3d9355509f Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Sun, 11 Dec 2011 09:31:47 +0000 Subject: [PATCH] Use local context to get messages --- includes/specials/SpecialChangePassword.php | 26 ++++++++++----------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/includes/specials/SpecialChangePassword.php b/includes/specials/SpecialChangePassword.php index 3ef842b123..f6482ef5b4 100644 --- a/includes/specials/SpecialChangePassword.php +++ b/includes/specials/SpecialChangePassword.php @@ -52,7 +52,7 @@ class SpecialChangePassword extends UnlistedSpecialPage { $user = $this->getUser(); if( !$request->wasPosted() && !$user->isLoggedIn() ) { - $this->error( wfMsg( 'resetpass-no-info' ) ); + $this->error( $this->msg( 'resetpass-no-info' )->text() ); return; } @@ -68,7 +68,7 @@ class SpecialChangePassword extends UnlistedSpecialPage { } $wgAuth->setDomain( $this->mDomain ); if( !$wgAuth->allowPasswordChange() ) { - $this->error( wfMsg( 'resetpass_forbidden' ) ); + $this->error( $this->msg( 'resetpass_forbidden' )->text() ); return; } @@ -125,7 +125,7 @@ class SpecialChangePassword extends UnlistedSpecialPage { '' . '' . Xml::checkLabel( - wfMsgExt( 'remembermypassword', 'parsemag', $this->getLanguage()->formatNum( ceil( $wgCookieExpiration / ( 3600 * 24 ) ) ) ), + $this->msg( 'remembermypassword' )->numParams( ceil( $wgCookieExpiration / ( 3600 * 24 ) ) )->text(), 'wpRemember', 'wpRemember', $this->getRequest()->getCheck( 'wpRemember' ) ) . '' . @@ -137,7 +137,7 @@ class SpecialChangePassword extends UnlistedSpecialPage { $submitMsg = 'resetpass-submit-loggedin'; } $this->getOutput()->addHTML( - Xml::fieldset( wfMsg( 'resetpass_header' ) ) . + Xml::fieldset( $this->msg( 'resetpass_header' )->text() ) . Xml::openElement( 'form', array( 'method' => 'post', @@ -147,7 +147,7 @@ class SpecialChangePassword extends UnlistedSpecialPage { Html::hidden( 'wpName', $this->mUserName ) . "\n" . Html::hidden( 'wpDomain', $this->mDomain ) . "\n" . Html::hidden( 'returnto', $this->getRequest()->getVal( 'returnto' ) ) . "\n" . - wfMsgExt( 'resetpass_text', array( 'parse' ) ) . "\n" . + $this->msg( 'resetpass_text' )->parseAsBlock() . "\n" . Xml::openElement( 'table', array( 'id' => 'mw-resetpass-table' ) ) . "\n" . $this->pretty( array( array( 'wpName', 'username', 'text', $this->mUserName ), @@ -159,8 +159,8 @@ class SpecialChangePassword extends UnlistedSpecialPage { "\n" . "\n" . '' . - Xml::submitButton( wfMsg( $submitMsg ) ) . - Xml::submitButton( wfMsg( 'resetpass-submit-cancel' ), array( 'name' => 'wpCancel' ) ) . + Xml::submitButton( $this->msg( $submitMsg )->text() ) . + Xml::submitButton( $this->msg( 'resetpass-submit-cancel' )->text(), array( 'name' => 'wpCancel' ) ) . "\n" . "\n" . Xml::closeElement( 'table' ) . @@ -189,9 +189,9 @@ class SpecialChangePassword extends UnlistedSpecialPage { $out .= "\n"; $out .= "\t"; if ( $type != 'text' ) - $out .= Xml::label( wfMsg( $label ), $name ); + $out .= Xml::label( $this->msg( $label )->text(), $name ); else - $out .= wfMsgHtml( $label ); + $out .= $this->msg( $label )->escaped(); $out .= "\n"; $out .= "\t"; $out .= $field; @@ -207,22 +207,22 @@ class SpecialChangePassword extends UnlistedSpecialPage { protected function attemptReset( $newpass, $retype ) { $user = User::newFromName( $this->mUserName ); if( !$user || $user->isAnon() ) { - throw new PasswordError( wfMsg( 'nosuchusershort', $this->mUserName ) ); + throw new PasswordError( $this->msg( 'nosuchusershort', $this->mUserName )->text() ); } if( $newpass !== $retype ) { wfRunHooks( 'PrefsPasswordAudit', array( $user, $newpass, 'badretype' ) ); - throw new PasswordError( wfMsg( 'badretype' ) ); + throw new PasswordError( $this->msg( 'badretype' )->text() ); } $throttleCount = LoginForm::incLoginThrottle( $this->mUserName ); if ( $throttleCount === true ) { - throw new PasswordError( wfMsg( 'login-throttled' ) ); + throw new PasswordError( $this->msg( 'login-throttled' )->text() ); } if( !$user->checkTemporaryPassword($this->mOldpass) && !$user->checkPassword($this->mOldpass) ) { wfRunHooks( 'PrefsPasswordAudit', array( $user, $newpass, 'wrongpassword' ) ); - throw new PasswordError( wfMsg( 'resetpass-wrong-oldpass' ) ); + throw new PasswordError( $this->msg( 'resetpass-wrong-oldpass' )->text() ); } // Please reset throttle for successful logins, thanks! -- 2.20.1