wp-includes/PHPMailer/PHPMailer.php:4371Replace a custom header.
$namestring$valuestring|nulloptionalnullbool public function replaceCustomHeader($name, $value = null) { if (null === $value && strpos($name, ':') !== false) { //Value passed in as name:value list($name, $value) = explode(':', $name, 2); } $name = trim($name); $value = (null === $value) ? '' : trim($value); $replaced = false; foreach ($this->CustomHeader as $k => $pair) { if ($pair[0] == $name) { if ($replaced) { unset($this->CustomHeader[$k]); continue; } if (strpbrk($name . $value, "\r\n") !== false) { if ($this->exceptions) { throw new Exception(self::lang('invalid_header')); } return false; } $this->CustomHeader[$k] = [$name, $value]; $replaced = true; } } return true; }Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 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.