wp-includes/PHPMailer/PHPMailer.php:3819Decode an RFC2047-encoded header value Attempts multiple strategies so it works even when the mbstring extension is disabled.
$valuestring$charsetstringoptionalself::CHARSET_ISO88591string public static function decodeHeader($value, $charset = self::CHARSET_ISO88591) { if (!is_string($value) || $value === '') { return ''; } // Detect the presence of any RFC2047 encoded-words $hasEncodedWord = (bool) preg_match('/=\?.*\?=/s', $value); if ($hasEncodedWord && defined('MB_CASE_UPPER')) { $origCharset = mb_internal_encoding(); // Always decode to UTF-8 to provide a consistent, modern output encoding. mb_internal_encoding($charset); if (PHP_VERSION_ID < 80300) { // Undo any RFC2047-encoded spaces-as-underscores. $value = str_replace('_', '=20', $value); } else { // PHP 8.3+ already interprets underscores as spaces. Remove additional // linear whitespace between adjacent encoded words to avoid double spacing. $value = preg_replace('/(\?=)\s+(=\?)/', '$1$2', $value); } // Decode the header value $value = mb_decode_mimeheader($value); mb_internal_encoding($origCharset); } return $value; }Unchanged from 6.9.7 through 7.1.0.
Signature, return type and hooks compared across 3 parsed releases.
src/wp-includes/PHPMailer/PHPMailer.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.