Fix assigment to static variable for old PHP versions

This commit is contained in:
Oleg Voronkovich 2023-03-03 17:50:15 +03:00
parent 067ff6e7c0
commit ecfef2e99c
1 changed files with 5 additions and 1 deletions

View File

@ -842,7 +842,11 @@ class PHPMailer
*/
public static function fromDSN($dsn, $exceptions = null)
{
static $configurator = new DSNConfigurator();
static $configurator = null;
if (null === $configurator) {
$configurator = new DSNConfigurator();
}
return $configurator->configure(new PHPMailer($exceptions), $dsn);
}