mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-03 08:40:10 +00:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@33124 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -4,25 +4,23 @@ require_once( ABSPATH . '/wp-includes/class-phpmailer.php' );
|
||||
class MockPHPMailer extends PHPMailer {
|
||||
var $mock_sent = array();
|
||||
|
||||
function preSend() {
|
||||
$this->Encoding = '8bit';
|
||||
return parent::preSend();
|
||||
}
|
||||
|
||||
/**
|
||||
* Override send() so mail isn't actually sent.
|
||||
* Override postSend() so mail isn't actually sent.
|
||||
*/
|
||||
function send() {
|
||||
try {
|
||||
if ( ! $this->preSend() )
|
||||
return false;
|
||||
function postSend() {
|
||||
$this->mock_sent[] = array(
|
||||
'to' => $this->to,
|
||||
'cc' => $this->cc,
|
||||
'bcc' => $this->bcc,
|
||||
'header' => $this->MIMEHeader,
|
||||
'body' => $this->MIMEBody,
|
||||
);
|
||||
|
||||
$this->mock_sent[] = array(
|
||||
'to' => $this->to,
|
||||
'cc' => $this->cc,
|
||||
'bcc' => $this->bcc,
|
||||
'header' => $this->MIMEHeader,
|
||||
'body' => $this->MIMEBody,
|
||||
);
|
||||
|
||||
return true;
|
||||
} catch ( phpmailerException $e ) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user