Permalink
Browse files

MDL-12524 fixed quoting of phrases in mail header (problem with speci…

…al chars in names of users); backported from MOODLE_19_STABLE
  • Loading branch information...
skodak
skodak committed Dec 17, 2007
1 parent 61bfc7e commit f4b987c7a4fa0dc82359fa3bc0f6e1d38eac5448
Showing with 7 additions and 3 deletions.
  1. +7 −3 lib/phpmailer/class.phpmailer.php
@@ -1192,9 +1192,13 @@ function EncodeHeader ($str, $position = 'text') {
/// Start Moodle Hack - do our own multibyte-safe header encoding
$textlib = textlib_get_instance();
- $result = $textlib->encode_mimeheader($str, $this->CharSet);
- if ($result !== false) {
- return $result;
+ $encoded = $textlib->encode_mimeheader($str, $this->CharSet);
+ if ($encoded !== false) {
+ $encoded = str_replace("\n", $this->LE, $encoded);
+ if ($position == 'phrase') {
+ return ("\"$encoded\"");
+ }
+ return $encoded;
}
// try the old way that does not handle binary-safe line splitting in mime header
/// End Moodle Hack

0 comments on commit f4b987c

Please sign in to comment.