From b2d3d3af6724d5867e4b19eb7c4c3cc3b6c8a05c Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Sat, 24 Mar 2012 19:45:05 +0100 Subject: [PATCH] Use local context to get messages Change-Id: I1a00bdca30132380640e872a5aa01c658d238202 --- includes/specials/SpecialPasswordReset.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/includes/specials/SpecialPasswordReset.php b/includes/specials/SpecialPasswordReset.php index 5e58841573..683a71422a 100644 --- a/includes/specials/SpecialPasswordReset.php +++ b/includes/specials/SpecialPasswordReset.php @@ -98,7 +98,7 @@ class SpecialPasswordReset extends FormSpecialPage { } public function alterForm( HTMLForm $form ) { - $form->setSubmitText( wfMessage( "mailmypassword" ) ); + $form->setSubmitTextMsg( 'mailmypassword' ); } protected function preText() { @@ -113,7 +113,7 @@ class SpecialPasswordReset extends FormSpecialPage { if ( isset( $wgPasswordResetRoutes['domain'] ) && $wgPasswordResetRoutes['domain'] ) { $i++; } - return wfMessage( 'passwordreset-pretext', $i )->parseAsBlock(); + return $this->msg( 'passwordreset-pretext', $i )->parseAsBlock(); } /** @@ -234,14 +234,14 @@ class SpecialPasswordReset extends FormSpecialPage { $password = $user->randomPassword(); $user->setNewpassword( $password ); $user->saveSettings(); - $passwords[] = wfMessage( 'passwordreset-emailelement', $user->getName(), $password )->plain(); // We'll escape the whole thing later + $passwords[] = $this->msg( 'passwordreset-emailelement', $user->getName(), $password )->plain(); // We'll escape the whole thing later } $passwordBlock = implode( "\n\n", $passwords ); // Send in the user's language; which should hopefully be the same $userLanguage = $firstUser->getOption( 'language' ); - $this->email = wfMessage( $msg )->inLanguage( $userLanguage ); + $this->email = $this->msg( $msg )->inLanguage( $userLanguage ); $this->email->params( $username, $passwordBlock, @@ -250,7 +250,7 @@ class SpecialPasswordReset extends FormSpecialPage { round( $wgNewPasswordExpiry / 86400 ) ); - $title = wfMessage( 'passwordreset-emailtitle' ); + $title = $this->msg( 'passwordreset-emailtitle' ); $this->result = $firstUser->sendMail( $title->escaped(), $this->email->escaped() ); -- 2.20.1