Skip to content

Commit 98af3c5

Browse files
Coding Standards: Move specific sniff exclusions for PHPMailer to the config file.
This aims to make future updates of the library easier. Follow-up to [48045], [51635]. See #63168. git-svn-id: https://develop.svn.wordpress.org/trunk@60797 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 2e3248f commit 98af3c5

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

phpcompat.xml.dist

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,15 @@
7676
#############################################################################
7777
-->
7878

79+
<rule ref="PHPCompatibility.IniDirectives.RemovedIniDirectives.mbstring_func_overloadDeprecated">
80+
<exclude-pattern>/PHPMailer/PHPMailer\.php$</exclude-pattern>
81+
</rule>
82+
<rule ref="PHPCompatibility.Constants.RemovedConstants.intl_idna_variant_2003Deprecated">
83+
<exclude-pattern>/PHPMailer/PHPMailer\.php$</exclude-pattern>
84+
</rule>
85+
<rule ref="PHPCompatibility.ParameterValues.NewIDNVariantDefault.NotSet">
86+
<exclude-pattern>/PHPMailer/PHPMailer\.php$</exclude-pattern>
87+
</rule>
7988
<rule ref="PHPCompatibility.FunctionUse.NewFunctions.sodium_crypto_sign_keypair_from_secretkey_and_publickeyFound">
8089
<exclude-pattern>/sodium_compat/src/Compat\.php$</exclude-pattern>
8190
</rule>

src/wp-includes/PHPMailer/PHPMailer.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -876,7 +876,7 @@ public function __destruct()
876876
private function mailPassthru($to, $subject, $body, $header, $params)
877877
{
878878
//Check overloading of mail function to avoid double-encoding
879-
if ((int)ini_get('mbstring.func_overload') & 1) { // phpcs:ignore PHPCompatibility.IniDirectives.RemovedIniDirectives.mbstring_func_overloadDeprecated
879+
if ((int)ini_get('mbstring.func_overload') & 1) {
880880
$subject = $this->secureHeader($subject);
881881
} else {
882882
$subject = $this->encodeHeader($this->secureHeader($subject));
@@ -1532,11 +1532,9 @@ public function punyencodeAddress($address)
15321532
);
15331533
} elseif (defined('INTL_IDNA_VARIANT_2003')) {
15341534
//Fall back to this old, deprecated/removed encoding
1535-
// phpcs:ignore PHPCompatibility.Constants.RemovedConstants.intl_idna_variant_2003Deprecated
15361535
$punycode = idn_to_ascii($domain, $errorcode, \INTL_IDNA_VARIANT_2003);
15371536
} else {
15381537
//Fall back to a default we don't know about
1539-
// phpcs:ignore PHPCompatibility.ParameterValues.NewIDNVariantDefault.NotSet
15401538
$punycode = idn_to_ascii($domain, $errorcode);
15411539
}
15421540
if (false !== $punycode) {

0 commit comments

Comments
 (0)