]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-12524 fixed quoting of phrases in mail header (problem with special chars in...
authorskodak <skodak>
Mon, 17 Dec 2007 21:39:03 +0000 (21:39 +0000)
committerskodak <skodak>
Mon, 17 Dec 2007 21:39:03 +0000 (21:39 +0000)
lib/phpmailer/class.phpmailer.php

index 8115b5d47490a44c54d79c7d9cb8bc479e5e420e..a91b4204e6ea42e1bdb814da9e8ddded2d520f02 100644 (file)
@@ -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