From 126a4bc47bac509c45fbd2e57b5f5da08cfbdc65 Mon Sep 17 00:00:00 2001 From: Clement Smith Date: Tue, 31 May 2016 14:05:44 -0500 Subject: [PATCH] MDL-50824 message/externallib.php: Fix get_string call This fixes the get_string call by adding the intended recipient's fullname as the third argument when a user tries to message the recipient, the recipient is blocking non-contacts from messaging them, and the user is not in the recipient's contact list. --- message/externallib.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/message/externallib.php b/message/externallib.php index 88d0a5f71bd..6702c3b5438 100644 --- a/message/externallib.php +++ b/message/externallib.php @@ -137,7 +137,8 @@ class core_message_external extends external_api { if ($success && empty($contactlist[$message['touserid']]) && !empty($blocknoncontacts)) { // The user isn't a contact and they have selected to block non contacts so this message won't be sent. $success = false; - $errormessage = get_string('userisblockingyounoncontact', 'message'); + $errormessage = get_string('userisblockingyounoncontact', 'message', + fullname(core_user::get_user($message['touserid']))); } //now we can send the message (at least try)