From c4a89f1635d86a1bbad354f0578298fcbac61d95 Mon Sep 17 00:00:00 2001 From: desrosj Date: Mon, 15 Jun 2020 14:56:07 +0000 Subject: [PATCH] General: Continuing to work towards a passing PHP Compatibility scan. - Add `phpcs:ignore` statements to compatibility checks in PHPMailer. - Remove quotes around the assertion in an `assert()` call. This will trigger a deprecated notice under certain conditions on PHP 7.2. Props jrf, desrosj. See #49922, #48033. Built from https://develop.svn.wordpress.org/trunk@48045 git-svn-id: http://core.svn.wordpress.org/trunk@47812 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/PHPMailer/PHPMailer.php | 5 ++++- wp-includes/Text/Diff/Engine/shell.php | 2 +- wp-includes/version.php | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/wp-includes/PHPMailer/PHPMailer.php b/wp-includes/PHPMailer/PHPMailer.php index ed14d7c7a2..27af1a937b 100644 --- a/wp-includes/PHPMailer/PHPMailer.php +++ b/wp-includes/PHPMailer/PHPMailer.php @@ -853,7 +853,7 @@ class PHPMailer private function mailPassthru($to, $subject, $body, $header, $params) { //Check overloading of mail function to avoid double-encoding - if (ini_get('mbstring.func_overload') & 1) { + if (ini_get('mbstring.func_overload') & 1) { // phpcs:ignore PHPCompatibility.IniDirectives.RemovedIniDirectives.mbstring_func_overloadDeprecated $subject = $this->secureHeader($subject); } else { $subject = $this->encodeHeader($this->secureHeader($subject)); @@ -1401,10 +1401,13 @@ class PHPMailer //Ignore IDE complaints about this line - method signature changed in PHP 5.4 $errorcode = 0; if (defined('INTL_IDNA_VARIANT_UTS46')) { + // phpcs:ignore PHPCompatibility.ParameterValues.NewIDNVariantDefault.NotSet $punycode = idn_to_ascii($domain, $errorcode, INTL_IDNA_VARIANT_UTS46); } elseif (defined('INTL_IDNA_VARIANT_2003')) { + // phpcs:ignore PHPCompatibility.Constants.RemovedConstants.intl_idna_variant_2003Deprecated $punycode = idn_to_ascii($domain, $errorcode, INTL_IDNA_VARIANT_2003); } else { + // phpcs:ignore PHPCompatibility.ParameterValues.NewIDNVariantDefault.NotSet $punycode = idn_to_ascii($domain, $errorcode); } if (false !== $punycode) { diff --git a/wp-includes/Text/Diff/Engine/shell.php b/wp-includes/Text/Diff/Engine/shell.php index 91c1843b83..a2ccc70db8 100644 --- a/wp-includes/Text/Diff/Engine/shell.php +++ b/wp-includes/Text/Diff/Engine/shell.php @@ -83,7 +83,7 @@ class Text_Diff_Engine_shell { if ($from_line_no < $match[1] || $to_line_no < $match[4]) { // copied lines - assert('$match[1] - $from_line_no == $match[4] - $to_line_no'); + assert($match[1] - $from_line_no == $match[4] - $to_line_no); array_push($edits, new Text_Diff_Op_copy( $this->_getLines($from_lines, $from_line_no, $match[1] - 1), diff --git a/wp-includes/version.php b/wp-includes/version.php index 53d221b49f..b43114535b 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.5-alpha-48044'; +$wp_version = '5.5-alpha-48045'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.