Make WordPress Core

Ticket #28039: 28039.patch

File 28039.patch, 1.8 KB (added by rzen, 11 years ago)
  • wp-includes/class-phpmailer.php

     
    410410     *   string  $subject       the subject
    411411     *   string  $body          the email body
    412412     *   string  $from          email address of sender
    413      * 
     413     *
    414414     * @type string
    415415     */
    416416    public $action_function = '';
     
    16671667    public function getMailMIME()
    16681668    {
    16691669        $result = '';
     1670        $ismultipart = true;
    16701671        switch ($this->message_type) {
    16711672            case 'inline':
    16721673                $result .= $this->headerLine('Content-Type', 'multipart/related;');
     
    16871688            default:
    16881689                // Catches case 'plain': and case '':
    16891690                $result .= $this->textLine('Content-Type: ' . $this->ContentType . '; charset=' . $this->CharSet);
     1691                $ismultipart = false;
    16901692                break;
    16911693        }
    16921694        //RFC1341 part 5 says 7bit is assumed if not specified
    16931695        if ($this->Encoding != '7bit') {
    1694             $result .= $this->headerLine('Content-Transfer-Encoding', $this->Encoding);
     1696            //RFC 2045 section 6.4 says multipart MIME parts may only use 7bit, 8bit or binary CTE
     1697            if ($ismultipart) {
     1698                if ($this->Encoding == '8bit') {
     1699                    $result .= $this->headerLine('Content-Transfer-Encoding', '8bit');
     1700                }
     1701                //The only remaining alternatives are quoted-printable and base64, which are both 7bit compatible
     1702            } else {
     1703                $result .= $this->headerLine('Content-Transfer-Encoding', $this->Encoding);
     1704            }
    16951705        }
    16961706
    16971707        if ($this->Mailer != 'mail') {