Fixed ErrorException: [E_DEPRECATED] strtolower(): Passing null to parameter #1 ($string) of type string is deprecated

ZixDev

Member
Affected version
v2.2.8 Patch 1
I'm using PHP 8.1.1
Server error log
  • ErrorException: [E_DEPRECATED] strtolower(): Passing null to parameter #1 ($string) of type string is deprecated
  • src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/Esmtp/AuthHandler.php:256
  • Generated by: Unknown account
  • Jan 23, 2022 at 10:32 PM

Stack trace​

#0 [internal function]: XF::handlePhpError(8192, '[E_DEPRECATED] ...', '/Users/zix/Docu...', 256)
#1 src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/Esmtp/AuthHandler.php(256): strtolower(NULL)
#2 src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/Esmtp/AuthHandler.php(173): Swift_Transport_Esmtp_AuthHandler->getAuthenticatorsForAgent()
#3 src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/EsmtpTransport.php(371): Swift_Transport_Esmtp_AuthHandler->afterEhlo(Object(XF\Mail\SmtpTransport))
#4 src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php(148): Swift_Transport_EsmtpTransport->doHeloCommand()
#5 src/XF/Mail/Mailer.php(288): Swift_Transport_AbstractSmtpTransport->start()
#6 src/XF/Mail/Queue.php(148): XF\Mail\Mailer->send(Object(Swift_Message), Object(XF\Mail\SmtpTransport), Array)
#7 src/XF/Job/MailQueue.php(12): XF\Mail\Queue->run(7.99007)
#8 src/XF/Job/Manager.php(260): XF\Job\MailQueue->run(7.99007)
#9 src/XF/Job/Manager.php(202): XF\Job\Manager->runJobInternal(Array, 7.99007)
#10 src/XF/Job/Manager.php(86): XF\Job\Manager->runJobEntry(Array, 7.99007)
#11 job.php(43): XF\Job\Manager->runQueue(false, 8)
#12 {main}
 

Moshe1010

Well-known member
Just happened to us as well with PHP 8.1 and XF 2.2.10 Patch 1:

  • ErrorException: [E_DEPRECATED] strtolower(): Passing null to parameter #1 ($string) of type string is deprecated
  • src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/Esmtp/AuthHandler.php:256
  • Generated by: Unknown account

Stack trace​

#0 [internal function]: XF::handlePhpError(8192, '[E_DEPRECATED] ...', '/home/devsite/de...', 256)
#1 src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/Esmtp/AuthHandler.php(256): strtolower(NULL)
#2 src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/Esmtp/AuthHandler.php(173): Swift_Transport_Esmtp_AuthHandler->getAuthenticatorsForAgent()
#3 src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/EsmtpTransport.php(371): Swift_Transport_Esmtp_AuthHandler->afterEhlo(Object(XF\Mail\SmtpTransport))
#4 src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php(148): Swift_Transport_EsmtpTransport->doHeloCommand()
#5 src/XF/Mail/Mailer.php(294): Swift_Transport_AbstractSmtpTransport->start()
#6 src/addons/TickTackk/DeveloperTools/XF/Mail/Mailer.php(36): XF\Mail\Mailer->send(Object(Swift_Message), Object(XF\Mail\SmtpTransport), Array, true)
#7 src/XF/Mail/Queue.php(148): TickTackk\DeveloperTools\XF\Mail\Mailer->send(Object(Swift_Message), NULL, Array)
#8 src/XF/Job/MailQueue.php(12): XF\Mail\Queue->run(8)
#9 src/XF/Job/Manager.php(260): XF\Job\MailQueue->run(8)
#10 src/XF/Job/Manager.php(202): XF\Job\Manager->runJobInternal(Array, 8)
#11 src/XF/Job/Manager.php(86): XF\Job\Manager->runJobEntry(Array, 8)
#12 src/XF/Cli/Command/RunJobs.php(59): XF\Job\Manager->runQueue(false, 8)
#13 src/vendor/symfony/console/Command/Command.php(255): XF\Cli\Command\RunJobs->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#14 src/vendor/symfony/console/Application.php(992): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#15 src/vendor/symfony/console/Application.php(255): Symfony\Component\Console\Application->doRunCommand(Object(XF\Cli\Command\RunJobs), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#16 src/vendor/symfony/console/Application.php(148): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#17 src/XF/Cli/Runner.php(111): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#18 cmd.php(15): XF\Cli\Runner->run()
#19 {main}

Request state​

array(1) {
["cli"] => string(46) "/home/devsite/cmd.php xf:run-jobs"
}
 
Last edited:

XF Bug Bot

XenForo bug fixer bot
Staff member
Thank you for reporting this issue, it has now been resolved. We are aiming to include any changes that have been made in a future XF release (2.2.11).

Change log:
Update Swiftmailer to v6.3.0 for PHP 8.1 support
There may be a delay before changes are rolled out to the XenForo Community.
 
Top