0
0
mirror of https://github.com/PHPMailer/PHPMailer.git synced 2024-09-20 01:52:15 +02:00

Merge pull request #2728 from evan70/master

trim(): Passing null to parameter  ($string) of type string is deprecated
This commit is contained in:
Marcus Bointon 2022-07-08 00:15:12 +02:00 committed by GitHub
commit 4d44b65893
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1288,7 +1288,7 @@ class PHPMailer
*/
public function setFrom($address, $name = '', $auto = true)
{
$address = trim($address);
$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().
$pos = strrpos($address, '@');