From: Brad Jorsch Date: Thu, 16 Jun 2016 16:03:59 +0000 (-0400) Subject: Fix handling of error messages from the 'SpecialPasswordResetOnSubmit' hook X-Git-Tag: 1.31.0-rc.0~6590^2 X-Git-Url: http://git.cyclocoop.org/wiki/Target_page?a=commitdiff_plain;h=b6487447463de476ad1b8bc0eff3d4972c9d44b8;p=lhc%2Fweb%2Fwiklou.git Fix handling of error messages from the 'SpecialPasswordResetOnSubmit' hook $error might be an array of key + values, but wfMessage() treats that as an array of alternative message keys instead so the values are lost. Message::newFromSpecifier(), on the other hand, does exactly what we want. Change-Id: I25765869f6888ac793c2af9caaa9bbdf2224d51a --- diff --git a/includes/user/PasswordReset.php b/includes/user/PasswordReset.php index 60144bb5d6..bc87cd03dd 100644 --- a/includes/user/PasswordReset.php +++ b/includes/user/PasswordReset.php @@ -153,7 +153,7 @@ class PasswordReset { 'Capture' => $displayPassword ? '1' : null, ]; if ( !Hooks::run( 'SpecialPasswordResetOnSubmit', [ &$users, $data, &$error ] ) ) { - return StatusValue::newFatal( wfMessage( $error ) ); + return StatusValue::newFatal( Message::newFromSpecifier( $error ) ); } if ( !$users ) {