Skip to content

Commit

Permalink
External Libraries: Upgrade PHPMailer to version 6.9.3.
Browse files Browse the repository at this point in the history
This is a maintenance release, adding support for the release version of PHP 8.4, and experimental support for PHP 8.5.

References:
* [https://github.com/PHPMailer/PHPMailer/releases/tag/v6.9.3 PHPMailer 6.9.3 release notes]
* [PHPMailer/PHPMailer@v6.9.2...v6.9.3 Full list of changes in PHPMailer 6.9.3]

Follow-up to [50628], [50799], [51169], [51634], [51635], [52252], [52749], [52811], [53500], [53535], [53917], [54427], [54937], [55557], [56484], [57137], [59246].

Props desrosj, yogeshbhutkar, ayeshrajans.
Fixes #62632.

git-svn-id: https://develop.svn.wordpress.org/trunk@59481 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
SergeyBiryukov committed Dec 3, 2024
1 parent d93b275 commit 8eb8d63
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
20 changes: 10 additions & 10 deletions src/wp-includes/PHPMailer/PHPMailer.php
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ class PHPMailer
* You can set your own, but it must be in the format "<id@domain>",
* as defined in RFC5322 section 3.6.4 or it will be ignored.
*
* @see https://tools.ietf.org/html/rfc5322#section-3.6.4
* @see https://www.rfc-editor.org/rfc/rfc5322#section-3.6.4
*
* @var string
*/
Expand Down Expand Up @@ -387,7 +387,7 @@ class PHPMailer
* 'DELAY' will notify you if there is an unusual delay in delivery, but the actual
* delivery's outcome (success or failure) is not yet decided.
*
* @see https://tools.ietf.org/html/rfc3461 See section 4.1 for more information about NOTIFY
* @see https://www.rfc-editor.org/rfc/rfc3461.html#section-4.1 for more information about NOTIFY
*/
public $dsn = '';

Expand Down Expand Up @@ -756,7 +756,7 @@ class PHPMailer
*
* @var string
*/
const VERSION = '6.9.2';
const VERSION = '6.9.3';

/**
* Error severity: message only, continue processing.
Expand Down Expand Up @@ -1873,7 +1873,7 @@ protected static function isShellSafe($string)
*/
protected static function isPermittedPath($path)
{
//Matches scheme definition from https://tools.ietf.org/html/rfc3986#section-3.1
//Matches scheme definition from https://www.rfc-editor.org/rfc/rfc3986#section-3.1
return !preg_match('#^[a-z][a-z\d+.-]*://#i', $path);
}

Expand Down Expand Up @@ -2707,7 +2707,7 @@ public function createHeader()
}

//Only allow a custom message ID if it conforms to RFC 5322 section 3.6.4
//https://tools.ietf.org/html/rfc5322#section-3.6.4
//https://www.rfc-editor.org/rfc/rfc5322#section-3.6.4
if (
'' !== $this->MessageID &&
preg_match(
Expand Down Expand Up @@ -4912,7 +4912,7 @@ public function DKIM_Sign($signHeader)
* Uses the 'relaxed' algorithm from RFC6376 section 3.4.2.
* Canonicalized headers should *always* use CRLF, regardless of mailer setting.
*
* @see https://tools.ietf.org/html/rfc6376#section-3.4.2
* @see https://www.rfc-editor.org/rfc/rfc6376#section-3.4.2
*
* @param string $signHeader Header
*
Expand All @@ -4924,7 +4924,7 @@ public function DKIM_HeaderC($signHeader)
$signHeader = static::normalizeBreaks($signHeader, self::CRLF);
//Unfold header lines
//Note PCRE \s is too broad a definition of whitespace; RFC5322 defines it as `[ \t]`
//@see https://tools.ietf.org/html/rfc5322#section-2.2
//@see https://www.rfc-editor.org/rfc/rfc5322#section-2.2
//That means this may break if you do something daft like put vertical tabs in your headers.
$signHeader = preg_replace('/\r\n[ \t]+/', ' ', $signHeader);
//Break headers out into an array
Expand Down Expand Up @@ -4956,7 +4956,7 @@ public function DKIM_HeaderC($signHeader)
* Uses the 'simple' algorithm from RFC6376 section 3.4.3.
* Canonicalized bodies should *always* use CRLF, regardless of mailer setting.
*
* @see https://tools.ietf.org/html/rfc6376#section-3.4.3
* @see https://www.rfc-editor.org/rfc/rfc6376#section-3.4.3
*
* @param string $body Message Body
*
Expand Down Expand Up @@ -4992,7 +4992,7 @@ public function DKIM_Add($headers_line, $subject, $body)
$DKIMquery = 'dns/txt'; //Query method
$DKIMtime = time();
//Always sign these headers without being asked
//Recommended list from https://tools.ietf.org/html/rfc6376#section-5.4.1
//Recommended list from https://www.rfc-editor.org/rfc/rfc6376#section-5.4.1
$autoSignHeaders = [
'from',
'to',
Expand Down Expand Up @@ -5098,7 +5098,7 @@ public function DKIM_Add($headers_line, $subject, $body)
}
//The DKIM-Signature header is included in the signature *except for* the value of the `b` tag
//which is appended after calculating the signature
//https://tools.ietf.org/html/rfc6376#section-3.5
//https://www.rfc-editor.org/rfc/rfc6376#section-3.5
$dkimSignatureHeader = 'DKIM-Signature: v=1;' .
' d=' . $this->DKIM_domain . ';' .
' s=' . $this->DKIM_selector . ';' . static::$LE .
Expand Down
12 changes: 6 additions & 6 deletions src/wp-includes/PHPMailer/SMTP.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class SMTP
*
* @var string
*/
const VERSION = '6.9.2';
const VERSION = '6.9.3';

/**
* SMTP line break constant.
Expand All @@ -62,7 +62,7 @@ class SMTP
* The maximum line length allowed by RFC 5321 section 4.5.3.1.6,
* *excluding* a trailing CRLF break.
*
* @see https://tools.ietf.org/html/rfc5321#section-4.5.3.1.6
* @see https://www.rfc-editor.org/rfc/rfc5321#section-4.5.3.1.6
*
* @var int
*/
Expand All @@ -72,7 +72,7 @@ class SMTP
* The maximum line length allowed for replies in RFC 5321 section 4.5.3.1.5,
* *including* a trailing CRLF line break.
*
* @see https://tools.ietf.org/html/rfc5321#section-4.5.3.1.5
* @see https://www.rfc-editor.org/rfc/rfc5321#section-4.5.3.1.5
*
* @var int
*/
Expand Down Expand Up @@ -373,7 +373,7 @@ public function connect($host, $port = null, $timeout = 30, $options = [])
}
//Anything other than a 220 response means something went wrong
//RFC 5321 says the server will wait for us to send a QUIT in response to a 554 error
//https://tools.ietf.org/html/rfc5321#section-3.1
//https://www.rfc-editor.org/rfc/rfc5321#section-3.1
if ($responseCode === 554) {
$this->quit();
}
Expand Down Expand Up @@ -582,7 +582,7 @@ public function authenticate(
}
//Send encoded username and password
if (
//Format from https://tools.ietf.org/html/rfc4616#section-2
//Format from https://www.rfc-editor.org/rfc/rfc4616#section-2
//We skip the first field (it's forgery), so the string starts with a null byte
!$this->sendCommand(
'User & Password',
Expand Down Expand Up @@ -795,7 +795,7 @@ public function data($msg_data)
//Send the lines to the server
foreach ($lines_out as $line_out) {
//Dot-stuffing as per RFC5321 section 4.5.2
//https://tools.ietf.org/html/rfc5321#section-4.5.2
//https://www.rfc-editor.org/rfc/rfc5321#section-4.5.2
if (!empty($line_out) && $line_out[0] === '.') {
$line_out = '.' . $line_out;
}
Expand Down

0 comments on commit 8eb8d63

Please sign in to comment.