validate value in replaceCustomHeader

This commit is contained in:
Frank Forte 2023-11-22 12:02:49 -05:00
parent 174653aa27
commit beb87e3cf7
1 changed files with 9 additions and 0 deletions

View File

@ -4077,9 +4077,18 @@ class PHPMailer
{
foreach ($this->CustomHeader as $k => $pair) {
if ($pair[0] == $name) {
if (strpbrk($name . $value, "\r\n") !== false) {
if ($this->exceptions) {
throw new Exception($this->lang('invalid_header'));
}
return false;
}
$this->CustomHeader[$k] = [$name, $value];
}
}
return true;
}
/**