Skip to content

Commit 6d10290

Browse files
committed
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. git-svn-id: https://develop.svn.wordpress.org/trunk@48045 602fd350-edb4-49c9-b593-d223f7449a82
1 parent d9c5324 commit 6d10290

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

src/wp-includes/PHPMailer/PHPMailer.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -853,7 +853,7 @@ public function __destruct()
853853
private function mailPassthru($to, $subject, $body, $header, $params)
854854
{
855855
//Check overloading of mail function to avoid double-encoding
856-
if (ini_get('mbstring.func_overload') & 1) {
856+
if (ini_get('mbstring.func_overload') & 1) { // phpcs:ignore PHPCompatibility.IniDirectives.RemovedIniDirectives.mbstring_func_overloadDeprecated
857857
$subject = $this->secureHeader($subject);
858858
} else {
859859
$subject = $this->encodeHeader($this->secureHeader($subject));
@@ -1401,10 +1401,13 @@ public function punyencodeAddress($address)
14011401
//Ignore IDE complaints about this line - method signature changed in PHP 5.4
14021402
$errorcode = 0;
14031403
if (defined('INTL_IDNA_VARIANT_UTS46')) {
1404+
// phpcs:ignore PHPCompatibility.ParameterValues.NewIDNVariantDefault.NotSet
14041405
$punycode = idn_to_ascii($domain, $errorcode, INTL_IDNA_VARIANT_UTS46);
14051406
} elseif (defined('INTL_IDNA_VARIANT_2003')) {
1407+
// phpcs:ignore PHPCompatibility.Constants.RemovedConstants.intl_idna_variant_2003Deprecated
14061408
$punycode = idn_to_ascii($domain, $errorcode, INTL_IDNA_VARIANT_2003);
14071409
} else {
1410+
// phpcs:ignore PHPCompatibility.ParameterValues.NewIDNVariantDefault.NotSet
14081411
$punycode = idn_to_ascii($domain, $errorcode);
14091412
}
14101413
if (false !== $punycode) {

src/wp-includes/Text/Diff/Engine/shell.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ function diff($from_lines, $to_lines)
8383

8484
if ($from_line_no < $match[1] || $to_line_no < $match[4]) {
8585
// copied lines
86-
assert('$match[1] - $from_line_no == $match[4] - $to_line_no');
86+
assert($match[1] - $from_line_no == $match[4] - $to_line_no);
8787
array_push($edits,
8888
new Text_Diff_Op_copy(
8989
$this->_getLines($from_lines, $from_line_no, $match[1] - 1),

0 commit comments

Comments
 (0)