Force CRLF in quoted-printable mime parts
authorTim Düsterhus <duesterhus@woltlab.com>
Thu, 2 Jun 2016 22:01:39 +0000 (00:01 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Thu, 28 Jul 2016 20:06:18 +0000 (22:06 +0200)
wcfsetup/install/files/lib/system/email/Email.class.php
wcfsetup/install/files/lib/system/email/mime/AbstractMultipartMimePart.class.php

index 9178af0c272a696ed54d5eceb5e83c63c2694d2f..2d8b382215212cc95e1484385c55aff7ba1dbbab 100644 (file)
@@ -450,7 +450,7 @@ class Email {
                
                switch ($this->body->getContentTransferEncoding()) {
                        case 'quoted-printable':
-                               return quoted_printable_encode($this->body->getContent());
+                               return quoted_printable_encode(str_replace("\n", "\r\n", StringUtil::unifyNewlines($this->body->getContent())));
                        break;
                        case 'base64':
                                return chunk_split(base64_encode($this->body->getContent()));
index 3abf8bee665a4c7b06787715f90787837e0be08a..4e806e52e206a819cf4a906b55db75dbbc67f75c 100644 (file)
@@ -76,7 +76,7 @@ abstract class AbstractMultipartMimePart extends AbstractMimePart implements IRe
                        $content .= "\r\n";
                        switch ($part->getContentTransferEncoding()) {
                                case 'quoted-printable':
-                                       $content .= quoted_printable_encode($part->getContent());
+                                       $content .= quoted_printable_encode(str_replace("\n", "\r\n", StringUtil::unifyNewlines($part->getContent())));
                                break;
                                case 'base64':
                                        $content .= chunk_split(base64_encode($part->getContent()));