From caec0405f455013f100362a893c0daaf28217eba Mon Sep 17 00:00:00 2001 From: Petr Skoda Date: Sat, 10 Mar 2012 10:46:36 +0100 Subject: [PATCH] MDL-31815 encode dots in confirm url which helps email clients with url highlighting --- lib/moodlelib.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/moodlelib.php b/lib/moodlelib.php index 5f948eb0e9f..cf4f19b8b33 100644 --- a/lib/moodlelib.php +++ b/lib/moodlelib.php @@ -5365,7 +5365,9 @@ function reset_password_and_mail($user) { $subject = get_string('emailconfirmationsubject', '', format_string($site->fullname)); - $data->link = $CFG->wwwroot .'/login/confirm.php?data='. $user->secret .'/'. urlencode($user->username); + $username = urlencode($user->username); + $username = str_replace('.', '%2E', $username); // prevent problems with trailing dots + $data->link = $CFG->wwwroot .'/login/confirm.php?data='. $user->secret .'/'. $username; $message = get_string('emailconfirmation', '', $data); $messagehtml = text_to_html(get_string('emailconfirmation', '', $data), false, false, true);