From 97cc7e0969a03cb071d791252f198393b730a522 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Mudr=C3=A1k?= Date: Mon, 22 May 2017 10:47:00 +0200 Subject: [PATCH] MDL-59012 auth_oauth2: Do not escape URL in plain text emails --- auth/oauth2/classes/api.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/auth/oauth2/classes/api.php b/auth/oauth2/classes/api.php index 689ad1ca8a2..9d678a8b8e8 100644 --- a/auth/oauth2/classes/api.php +++ b/auth/oauth2/classes/api.php @@ -192,10 +192,10 @@ class api { ]; $confirmationurl = new moodle_url('/auth/oauth2/confirm-linkedlogin.php', $params); - // Remove data parameter just in case it was included in the confirmation so we can add it manually later. - $data->link = $confirmationurl->out(); + $data->link = $confirmationurl->out(false); + $message = get_string('confirmlinkedloginemail', 'auth_oauth2', $data); - $message = get_string('confirmlinkedloginemail', 'auth_oauth2', $data); + $data->link = $confirmationurl->out(); $messagehtml = text_to_html(get_string('confirmlinkedloginemail', 'auth_oauth2', $data), false, false, true); $user->mailformat = 1; // Always send HTML version as well. @@ -303,9 +303,10 @@ class api { ]; $confirmationurl = new moodle_url('/auth/oauth2/confirm-account.php', $params); - $data->link = $confirmationurl->out(); + $data->link = $confirmationurl->out(false); + $message = get_string('confirmaccountemail', 'auth_oauth2', $data); - $message = get_string('confirmaccountemail', 'auth_oauth2', $data); + $data->link = $confirmationurl->out(); $messagehtml = text_to_html(get_string('confirmaccountemail', 'auth_oauth2', $data), false, false, true); $user->mailformat = 1; // Always send HTML version as well.