wp-includes/PHPMailer/PHPMailer.php:1343Parse a string containing an email address with an optional name and divide it into a name and email address.
$inputstringPHPMailer\PHPMailer\array{name: private static function parseEmailString($input) { $input = trim((string)$input); if ($input === '') { return ['name' => '', 'email' => '']; } $pattern = '/^\s*(?:(?:"([^"]*)"|\'([^\']*)\'|([^<]*?))\s*)?<\s*([^>]+)\s*>\s*$/'; if (preg_match($pattern, $input, $matches)) { $name = ''; // Double quotes including special scenarios. if (isset($matches[1]) && $matches[1] !== '') { $name = $matches[1]; // Single quotes including special scenarios. } elseif (isset($matches[2]) && $matches[2] !== '') { $name = $matches[2]; // Simplest scenario, name and email are in the format "Name <email>". } elseif (isset($matches[3])) { $name = trim($matches[3]); } return ['name' => $name, 'email' => trim($matches[4])]; } return ['name' => '', 'email' => $input]; }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.