Skip to content

Commit 267061c

Browse files
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: PHPMailer/PHPMailer@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
1 parent f6f8094 commit 267061c

File tree

3 files changed

+24
-9
lines changed

3 files changed

+24
-9
lines changed

wp-includes/PHPMailer/PHPMailer.php

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -748,7 +748,7 @@ class PHPMailer
748748
*
749749
* @var string
750750
*/
751-
const VERSION = '6.4.0';
751+
const VERSION = '6.4.1';
752752

753753
/**
754754
* Error severity: message only, continue processing.
@@ -1723,9 +1723,10 @@ protected function sendmailSend($header, $body)
17231723
fwrite($mail, $header);
17241724
fwrite($mail, $body);
17251725
$result = pclose($mail);
1726+
$addrinfo = static::parseAddresses($toAddr);
17261727
$this->doCallback(
17271728
($result === 0),
1728-
[$toAddr],
1729+
[[$addrinfo['address'], $addrinfo['name']]],
17291730
$this->cc,
17301731
$this->bcc,
17311732
$this->Subject,
@@ -1812,7 +1813,8 @@ protected static function isShellSafe($string)
18121813
*/
18131814
protected static function isPermittedPath($path)
18141815
{
1815-
return !preg_match('#^[a-z]+://#i', $path);
1816+
//Matches scheme definition from https://tools.ietf.org/html/rfc3986#section-3.1
1817+
return !preg_match('#^[a-z][a-z\d+.-]*://#i', $path);
18161818
}
18171819

18181820
/**
@@ -1824,12 +1826,15 @@ protected static function isPermittedPath($path)
18241826
*/
18251827
protected static function fileIsAccessible($path)
18261828
{
1829+
if (!static::isPermittedPath($path)) {
1830+
return false;
1831+
}
18271832
$readable = file_exists($path);
18281833
//If not a UNC path (expected to start with \\), check read permission, see #2069
18291834
if (strpos($path, '\\\\') !== 0) {
18301835
$readable = $readable && is_readable($path);
18311836
}
1832-
return static::isPermittedPath($path) && $readable;
1837+
return $readable;
18331838
}
18341839

18351840
/**
@@ -1878,7 +1883,17 @@ protected function mailSend($header, $body)
18781883
if ($this->SingleTo && count($toArr) > 1) {
18791884
foreach ($toArr as $toAddr) {
18801885
$result = $this->mailPassthru($toAddr, $this->Subject, $body, $header, $params);
1881-
$this->doCallback($result, [$toAddr], $this->cc, $this->bcc, $this->Subject, $body, $this->From, []);
1886+
$addrinfo = static::parseAddresses($toAddr);
1887+
$this->doCallback(
1888+
$result,
1889+
[[$addrinfo['address'], $addrinfo['name']]],
1890+
$this->cc,
1891+
$this->bcc,
1892+
$this->Subject,
1893+
$body,
1894+
$this->From,
1895+
[]
1896+
);
18821897
}
18831898
} else {
18841899
$result = $this->mailPassthru($to, $this->Subject, $body, $header, $params);
@@ -1967,7 +1982,7 @@ protected function smtpSend($header, $body)
19671982
$isSent = true;
19681983
}
19691984

1970-
$callbacks[] = ['issent' => $isSent, 'to' => $to[0]];
1985+
$callbacks[] = ['issent' => $isSent, 'to' => $to[0], 'name' => $to[1]];
19711986
}
19721987
}
19731988

@@ -1988,7 +2003,7 @@ protected function smtpSend($header, $body)
19882003
foreach ($callbacks as $cb) {
19892004
$this->doCallback(
19902005
$cb['issent'],
1991-
[$cb['to']],
2006+
[[$cb['to'], $cb['name']]],
19922007
[],
19932008
[],
19942009
$this->Subject,

wp-includes/PHPMailer/SMTP.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class SMTP
3535
*
3636
* @var string
3737
*/
38-
const VERSION = '6.4.0';
38+
const VERSION = '6.4.1';
3939

4040
/**
4141
* SMTP line break constant.

wp-includes/version.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
*
1414
* @global string $wp_version
1515
*/
16-
$wp_version = '5.8-alpha-50798';
16+
$wp_version = '5.8-alpha-50799';
1717

1818
/**
1919
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.

0 commit comments

Comments
 (0)