From 5730323b4b2ad70ccc1b53495adced8e59e3a1f9 Mon Sep 17 00:00:00 2001 From: skodak Date: Mon, 17 Dec 2007 21:39:03 +0000 Subject: [PATCH] MDL-12524 fixed quoting of phrases in mail header (problem with special chars in names of users); merged from MOODLE_19_STABLE --- lib/phpmailer/class.phpmailer.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/phpmailer/class.phpmailer.php b/lib/phpmailer/class.phpmailer.php index 8115b5d474..a91b4204e6 100644 --- a/lib/phpmailer/class.phpmailer.php +++ b/lib/phpmailer/class.phpmailer.php @@ -1192,9 +1192,13 @@ class PHPMailer /// 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 -- 2.39.5