Add workaround for #3163

This commit is contained in:
Marcus Bointon 2025-05-31 10:46:53 +02:00
parent 2efdf63a32
commit 912f278a48
No known key found for this signature in database
GPG Key ID: DE31CD6EB646AA24
1 changed files with 4 additions and 0 deletions

View File

@ -1334,6 +1334,10 @@ class PHPMailer
*/
public function setFrom($address, $name = '', $auto = true)
{
if (is_null($name)) {
//Helps avoid a deprecation warning in the preg_replace() below
$name = '';
}
$address = trim((string)$address);
$name = trim(preg_replace('/[\r\n]+/', '', $name)); //Strip breaks and trim
//Don't validate now addresses with IDN. Will be done in send().