Rejig setting XMailer to avoid PHP 8.1 issue, fixes #2635
This commit is contained in:
parent
7ac1bd3ac0
commit
b930f1587f
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
## WIP
|
||||
* If we can't use escaping functions, refuse to do unsafe things
|
||||
* Avoid PHP 8.1 trim issue
|
||||
|
||||
## Version 6.5.3 (November 25th, 2021)
|
||||
* Wrong commit tagged for the 6.5.2 release!
|
||||
|
|
|
|||
|
|
@ -2637,16 +2637,15 @@ class PHPMailer
|
|||
$result .= $this->headerLine('X-Priority', $this->Priority);
|
||||
}
|
||||
if ('' === $this->XMailer) {
|
||||
//Empty string for default X-Mailer header
|
||||
$result .= $this->headerLine(
|
||||
'X-Mailer',
|
||||
'PHPMailer ' . self::VERSION . ' (https://github.com/PHPMailer/PHPMailer)'
|
||||
);
|
||||
} else {
|
||||
$myXmailer = trim($this->XMailer);
|
||||
if ($myXmailer) {
|
||||
$result .= $this->headerLine('X-Mailer', $myXmailer);
|
||||
}
|
||||
}
|
||||
} elseif (is_string($this->XMailer) && trim($this->XMailer) !== '') {
|
||||
//Some string
|
||||
$result .= $this->headerLine('X-Mailer', trim($this->XMailer));
|
||||
} //Other values result in no X-Mailer header
|
||||
|
||||
if ('' !== $this->ConfirmReadingTo) {
|
||||
$result .= $this->headerLine('Disposition-Notification-To', '<' . $this->ConfirmReadingTo . '>');
|
||||
|
|
|
|||
Loading…
Reference in New Issue