From b6487447463de476ad1b8bc0eff3d4972c9d44b8 Mon Sep 17 00:00:00 2001 From: Brad Jorsch Date: Thu, 16 Jun 2016 12:03:59 -0400 Subject: [PATCH] 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 --- includes/user/PasswordReset.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 ) { -- 2.20.1