Make WordPress Core


Ignore:
Timestamp:
07/08/2015 05:15:02 PM (9 years ago)
Author:
ocean90
Message:

Update PHPMailer to 5.2.10 from 5.2.7.

Includes two modifications for WordPress:

  • Removes support for NTLM in class-smtp.php since the required client (extras/ntlm_sasl_client.php) is not distributed as part of WordPress.
  • Requires class-smtp.php for backwards compatibility with direct (non-wp_mail()) uses of PHPMailer, as the autoloader isn't used. See [27385].

This also includes a change to our MockMailer for unit tests. It now overrides postSend() instead of send(), and preSend()`.
preSend() resets $this->Encoding because PHPMailer doesn't clean up after itself / presets all variables. This becomes an issue when PHPMailer::createBody() sets $this->Encoding = 'quoted-printable' (away from it's default of 8bit) when it encounters a line longer than 998 characters. Tests_Comment::test_comment_field_lengths is such a case.

props MattyRob, dd32.
fixes #28909.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/includes/mock-mailer.php

    r27385 r33124  
    55    var $mock_sent = array();
    66
     7    function preSend() {
     8        $this->Encoding = '8bit';
     9        return parent::preSend();
     10    }
     11
    712    /**
    8      * Override send() so mail isn't actually sent.
     13     * Override postSend() so mail isn't actually sent.
    914     */
    10     function send() {
    11         try {
    12             if ( ! $this->preSend() )
    13                 return false;
     15    function postSend() {
     16        $this->mock_sent[] = array(
     17            'to'     => $this->to,
     18            'cc'     => $this->cc,
     19            'bcc'    => $this->bcc,
     20            'header' => $this->MIMEHeader,
     21            'body'   => $this->MIMEBody,
     22        );
    1423
    15             $this->mock_sent[] = array(
    16                 'to'     => $this->to,
    17                 'cc'     => $this->cc,
    18                 'bcc'    => $this->bcc,
    19                 'header' => $this->MIMEHeader,
    20                 'body'   => $this->MIMEBody,
    21             );
    22 
    23             return true;
    24         } catch ( phpmailerException $e ) {
    25             return false;
    26         }
     24        return true;
    2725    }
    2826}
Note: See TracChangeset for help on using the changeset viewer.