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

Lukas W.

Well-known member
Affected version
2.2.8
XF\Pub\Controller\Register Line 172 calls $this->assertBoardActive(null);, however the function call implicitly expects the first parameter to never be null, since it is run through strtolower before being passed on to the parent, which accepts null as value again.

Code:
public function assertBoardActive($action)
{
   switch (strtolower($action))
   {
      case 'connectedaccount':
         break;

      default:
         parent::assertBoardActive($action);
   }
}
 

PaulB

Well-known member
This should probably be tagged as a PHP 8.1 compatibility issue, even though it does seem like a bug.
 

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.9).

Change log:
Improve PHP 8.1 compatibility within the Register controller
There may be a delay before changes are rolled out to the XenForo Community.
 

VersoBit

Well-known member
Just wanted to check to see if this has been resolved in 2.2.9; We are getting this error on PHP 8.1 when sending mail:
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
 
Top