From 0afedf684d9b02477434389623b1ab1cccd92b3b Mon Sep 17 00:00:00 2001 From: moodler Date: Tue, 1 Mar 2005 07:06:42 +0000 Subject: [PATCH] Fixed the link for the confirmation email ... the & was breaking in some mail ... see also bug 2502 for something similar --- lib/moodlelib.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/moodlelib.php b/lib/moodlelib.php index 97e3d78921d..9c1cfefb298 100644 --- a/lib/moodlelib.php +++ b/lib/moodlelib.php @@ -3151,13 +3151,19 @@ function reset_password_and_mail($user) { $data->firstname = fullname($user); $data->sitename = $site->fullname; - $data->link = $CFG->wwwroot .'/login/confirm.php?p='. $user->secret .'&s='. $user->username; $data->admin = fullname($from) .' ('. $from->email .')'; - $message = get_string('emailconfirmation', '', $data); $subject = get_string('emailconfirmationsubject', '', $site->fullname); - $messagehtml = text_to_html($message, false, false, true); + /// Make the text version a normal link for normal people + $data->link = $CFG->wwwroot .'/login/confirm.php?p='. $user->secret .'&s='. $user->username; + $message = get_string('emailconfirmation', '', $data); + + /// Make the HTML version more XHTML happy (&) + $data->link = $CFG->wwwroot .'/login/confirm.php?p='. $user->secret .'&s='. $user->username; + $messagehtml = text_to_html(get_string('emailconfirmation', '', $data), false, false, true); + + $user->mailformat = 1; // Always send HTML version as well return email_to_user($user, $from, $subject, $message, $messagehtml);