From cc05e7b608a787db05b57045607e49ef22c8822f Mon Sep 17 00:00:00 2001 From: desrosj Date: Tue, 14 Jun 2022 14:38:10 +0000 Subject: [PATCH] External Libraries: Upgrade PHPMailer to version 6.6.2. Release notes: https://github.com/PHPMailer/PHPMailer/releases/tag/v6.6.2. For a full list of changes in this update, see the PHPMailer GitHub: https://github.com/PHPMailer/PHPMailer/compare/v6.6.0...v6.6.2. Props ayeshrajans, jrf. Fixes #55976. Built from https://develop.svn.wordpress.org/trunk@53500 git-svn-id: http://core.svn.wordpress.org/trunk@53089 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/PHPMailer/PHPMailer.php | 20 ++++++++++++++------ wp-includes/PHPMailer/SMTP.php | 7 +++++-- wp-includes/version.php | 2 +- 3 files changed, 20 insertions(+), 9 deletions(-) diff --git a/wp-includes/PHPMailer/PHPMailer.php b/wp-includes/PHPMailer/PHPMailer.php index 10f3fe8cda..13420c81dd 100644 --- a/wp-includes/PHPMailer/PHPMailer.php +++ b/wp-includes/PHPMailer/PHPMailer.php @@ -750,7 +750,7 @@ class PHPMailer * * @var string */ - const VERSION = '6.6.0'; + const VERSION = '6.6.2'; /** * Error severity: message only, continue processing. @@ -1066,8 +1066,8 @@ class PHPMailer * Addresses that have been added already return false, but do not throw exceptions. * * @param string $kind One of 'to', 'cc', 'bcc', or 'ReplyTo' - * @param string $address The email address to send, resp. to reply to - * @param string $name + * @param string $address The email address + * @param string $name An optional username associated with the address * * @throws Exception * @@ -1075,9 +1075,11 @@ class PHPMailer */ protected function addOrEnqueueAnAddress($kind, $address, $name) { - $address = trim($address); - $name = trim(preg_replace('/[\r\n]+/', '', $name)); //Strip breaks and trim - $pos = strrpos($address, '@'); + $pos = false; + if ($address !== null) { + $address = trim($address); + $pos = strrpos($address, '@'); + } if (false === $pos) { //At-sign is missing. $error_message = sprintf( @@ -1094,8 +1096,14 @@ class PHPMailer return false; } + if ($name !== null) { + $name = trim(preg_replace('/[\r\n]+/', '', $name)); //Strip breaks and trim + } else { + $name = ''; + } $params = [$kind, $address, $name]; //Enqueue addresses with IDN until we know the PHPMailer::$CharSet. + //Domain is assumed to be whatever is after the last @ symbol in the address if (static::idnSupported() && $this->has8bitChars(substr($address, ++$pos))) { if ('Reply-To' !== $kind) { if (!array_key_exists($address, $this->RecipientsQueue)) { diff --git a/wp-includes/PHPMailer/SMTP.php b/wp-includes/PHPMailer/SMTP.php index 5ecad21dae..64fd078267 100644 --- a/wp-includes/PHPMailer/SMTP.php +++ b/wp-includes/PHPMailer/SMTP.php @@ -35,7 +35,7 @@ class SMTP * * @var string */ - const VERSION = '6.6.0'; + const VERSION = '6.6.2'; /** * SMTP line break constant. @@ -1037,7 +1037,10 @@ class SMTP return false; } - $this->setError(''); + //Don't clear the error store when using keepalive + if ($command !== 'RSET') { + $this->setError(''); + } return true; } diff --git a/wp-includes/version.php b/wp-includes/version.php index 3cf4aa2bd0..868439c597 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.1-alpha-53499'; +$wp_version = '6.1-alpha-53500'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.