Permalink
Browse files

lib/email_to_user MDL-10384 Recipeint names broken

When emailcharset is not utf8 the charset conversion was breaking
recipient/replyto names

thanks to Tatsuya Shirai
backported from MOODLE_19_STABLE
  • Loading branch information...
1 parent 32bf9c2 commit 8fe8df969ecd47fd4f9a3b8d17ffd2d36a96c2cd poltawski committed Mar 25, 2009
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/moodlelib.php
View
@@ -3554,11 +3554,11 @@ function email_to_user($user, $from, $subject, $messagetext, $messagehtml='', $a
/// And convert some strings
$mail->FromName = $textlib->convert($mail->FromName, 'utf-8', $mail->CharSet); //From Name
foreach ($mail->ReplyTo as $key => $rt) { //ReplyTo Names
- $mail->ReplyTo[$key][1] = $textlib->convert($rt, 'utf-8', $mail->CharSet);
+ $mail->ReplyTo[$key][1] = $textlib->convert($rt[1], 'utf-8', $mail->CharSet);
}
$mail->Subject = $textlib->convert($mail->Subject, 'utf-8', $mail->CharSet); //Subject
foreach ($mail->to as $key => $to) {
- $mail->to[$key][1] = $textlib->convert($to, 'utf-8', $mail->CharSet); //To Names
+ $mail->to[$key][1] = $textlib->convert($to[1], 'utf-8', $mail->CharSet); //To Names
}
$mail->Body = $textlib->convert($mail->Body, 'utf-8', $mail->CharSet); //Body
$mail->AltBody = $textlib->convert($mail->AltBody, 'utf-8', $mail->CharSet); //Subject

0 comments on commit 8fe8df9

Please sign in to comment.