Skip to content

Commit

Permalink
MDL-12524 fixed quoting of phrases in mail header (problem with speci…
Browse files Browse the repository at this point in the history
…al chars in names of users); merged from MOODLE_19_STABLE
  • Loading branch information
skodak committed Dec 17, 2007
1 parent 636b8f1 commit 5730323
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lib/phpmailer/class.phpmailer.php
Expand Up @@ -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
Expand Down

0 comments on commit 5730323

Please sign in to comment.