Make WordPress Core


Ignore:
Timestamp:
07/08/2015 05:15:02 PM (10 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/tests/mail.php

    r32839 r33124  
    88        parent::setUp();
    99        unset( $GLOBALS['phpmailer']->mock_sent );
     10    }
     11
     12    /**
     13     * Send a mail with a 1000 char long line.
     14     *
     15     * `PHPMailer::createBody()` will set `$this->Encoding = 'quoted-printable'` (away from it's default of 8bit)
     16     * when it encounters a line longer than 999 characters. But PHPMailer doesn't clean up after itself / presets
     17     * all variables, which means that following tests would fail. To solve this issue we set `$this->Encoding`
     18     * back to 8bit in `MockPHPMailer::preSend`.
     19     *
     20     */
     21    function test_wp_mail_break_it() {
     22        $content = str_repeat( 'A', 1000 );
     23        wp_mail( "admin@example.org", 'Looong line testing', $content);
    1024    }
    1125
Note: See TracChangeset for help on using the changeset viewer.