wp-includes/PHPMailer/PHPMailer.php:1301Parse and validate a string containing one or more RFC822-style comma-separated email addresses of the form "display name <address>" into an array of name/address pairs.
$addrstrstring$useimapbool|nulloptionalnull$charsetstringoptionalself::CHARSET_ISO88591array public static function parseAddresses($addrstr, $useimap = null, $charset = self::CHARSET_ISO88591) { if ($useimap == true) { trigger_error(self::lang('deprecated_argument') . '$useimap', E_USER_DEPRECATED); } $addresses = []; if ($useimap == true && function_exists('imap_rfc822_parse_adrlist')) { //Use this built-in parser if it's available // phpcs:ignore PHPCompatibility.FunctionUse.RemovedFunctions.imap_rfc822_parse_adrlistRemoved -- wrapped in function_exists() $list = imap_rfc822_parse_adrlist($addrstr, ''); // Clear any potential IMAP errors to get rid of notices being thrown at end of script. // phpcs:ignore PHPCompatibility.FunctionUse.RemovedFunctions.imap_errorsRemoved -- wrapped in function_exists() imap_errors(); foreach ($list as $address) { if ( '.SYNTAX-ERROR.' !== $address->host && static::validateAddress($address->mailbox . '@' . $address->host) ) { //Decode the name part if it's present and maybe encoded if ( property_exists($address, 'personal') && is_string($address->personal) && $address->personal !== '' ) { $address->personal = static::decodeHeader($address->personal, $charset); } $addresses[] = [ 'name' => (property_exists($address, 'personal') ? $address->personal : ''), 'address' => $address->mailbox . '@' . $address->host, ]; } } } else { //Use this simpler parser $addresses = static::parseSimplerAddresses($addrstr, $charset); } return $addresses; }2 changes between 6.7.7 and 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
$useimap retyped from null to bool|null.verified against source$useimap retyped from bool to null.verified against sourcesrc/wp-includes/PHPMailer/PHPMailer.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.