External Libraries: Upgrade PHPMailer to version 6.4.1.

Release notes: https://github.com/PHPMailer/PHPMailer/releases/tag/v6.4.1

For a full list of changes in this update, see the PHPMailer GitHub:
https://github.com/PHPMailer/PHPMailer/compare/v6.4.0...v6.4.1

Props ayeshrajans.
Fixes #53114.
Built from https://develop.svn.wordpress.org/trunk@50799


git-svn-id: http://core.svn.wordpress.org/trunk@50408 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2021-04-29 20:30:06 +00:00
parent f6f8094b1d
commit 267061c959
3 changed files with 24 additions and 9 deletions

View File

@ -748,7 +748,7 @@ class PHPMailer
* *
* @var string * @var string
*/ */
const VERSION = '6.4.0'; const VERSION = '6.4.1';
/** /**
* Error severity: message only, continue processing. * Error severity: message only, continue processing.
@ -1723,9 +1723,10 @@ class PHPMailer
fwrite($mail, $header); fwrite($mail, $header);
fwrite($mail, $body); fwrite($mail, $body);
$result = pclose($mail); $result = pclose($mail);
$addrinfo = static::parseAddresses($toAddr);
$this->doCallback( $this->doCallback(
($result === 0), ($result === 0),
[$toAddr], [[$addrinfo['address'], $addrinfo['name']]],
$this->cc, $this->cc,
$this->bcc, $this->bcc,
$this->Subject, $this->Subject,
@ -1812,7 +1813,8 @@ class PHPMailer
*/ */
protected static function isPermittedPath($path) protected static function isPermittedPath($path)
{ {
return !preg_match('#^[a-z]+://#i', $path); //Matches scheme definition from https://tools.ietf.org/html/rfc3986#section-3.1
return !preg_match('#^[a-z][a-z\d+.-]*://#i', $path);
} }
/** /**
@ -1824,12 +1826,15 @@ class PHPMailer
*/ */
protected static function fileIsAccessible($path) protected static function fileIsAccessible($path)
{ {
if (!static::isPermittedPath($path)) {
return false;
}
$readable = file_exists($path); $readable = file_exists($path);
//If not a UNC path (expected to start with \\), check read permission, see #2069 //If not a UNC path (expected to start with \\), check read permission, see #2069
if (strpos($path, '\\\\') !== 0) { if (strpos($path, '\\\\') !== 0) {
$readable = $readable && is_readable($path); $readable = $readable && is_readable($path);
} }
return static::isPermittedPath($path) && $readable; return $readable;
} }
/** /**
@ -1878,7 +1883,17 @@ class PHPMailer
if ($this->SingleTo && count($toArr) > 1) { if ($this->SingleTo && count($toArr) > 1) {
foreach ($toArr as $toAddr) { foreach ($toArr as $toAddr) {
$result = $this->mailPassthru($toAddr, $this->Subject, $body, $header, $params); $result = $this->mailPassthru($toAddr, $this->Subject, $body, $header, $params);
$this->doCallback($result, [$toAddr], $this->cc, $this->bcc, $this->Subject, $body, $this->From, []); $addrinfo = static::parseAddresses($toAddr);
$this->doCallback(
$result,
[[$addrinfo['address'], $addrinfo['name']]],
$this->cc,
$this->bcc,
$this->Subject,
$body,
$this->From,
[]
);
} }
} else { } else {
$result = $this->mailPassthru($to, $this->Subject, $body, $header, $params); $result = $this->mailPassthru($to, $this->Subject, $body, $header, $params);
@ -1967,7 +1982,7 @@ class PHPMailer
$isSent = true; $isSent = true;
} }
$callbacks[] = ['issent' => $isSent, 'to' => $to[0]]; $callbacks[] = ['issent' => $isSent, 'to' => $to[0], 'name' => $to[1]];
} }
} }
@ -1988,7 +2003,7 @@ class PHPMailer
foreach ($callbacks as $cb) { foreach ($callbacks as $cb) {
$this->doCallback( $this->doCallback(
$cb['issent'], $cb['issent'],
[$cb['to']], [[$cb['to'], $cb['name']]],
[], [],
[], [],
$this->Subject, $this->Subject,

View File

@ -35,7 +35,7 @@ class SMTP
* *
* @var string * @var string
*/ */
const VERSION = '6.4.0'; const VERSION = '6.4.1';
/** /**
* SMTP line break constant. * SMTP line break constant.

View File

@ -13,7 +13,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '5.8-alpha-50798'; $wp_version = '5.8-alpha-50799';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.