PHP error: Deprecated function: str_replace

Created on 2 February 2023, almost 2 years ago
Updated 22 February 2023, almost 2 years ago

I'm seeing the following PHP error messages in watchdog after updating to 9.2.2:


Deprecated function: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in Cleantalk\Common\Firewall\Modules\Sfw->diePage() (line 398 of /public_html/modules/contrib/cleantalk/lib/Cleantalk/Common/Firewall/Modules/Sfw.php)
#0 /public_html/core/includes/bootstrap.inc(347): _drupal_error_handler_real(8192, 'str_replace(): ...', '/...', 398)
#1 [internal function]: _drupal_error_handler(8192, 'str_replace(): ...', '/...', 398)
#2 /public_html/modules/contrib/cleantalk/lib/Cleantalk/Common/Firewall/Modules/Sfw.php(398): str_replace('{SERVICE_ID}', NULL, '...')
#3 /public_html/modules/contrib/cleantalk/lib/Cleantalk/Common/Firewall/Firewall.php(230): Cleantalk\Common\Firewall\Modules\Sfw->diePage(Array)
#4 /public_html/modules/contrib/cleantalk/src/EventSubscriber/BootSubscriber.php(157): Cleantalk\Common\Firewall\Firewall->run()
#5 /public_html/core/modules/ban/src/BanMiddleware.php(50): Drupal\cleantalk\EventSubscriber\BootSubscriber->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#6 /public_html/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\ban\BanMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#7 /public_html/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#8 /vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#9 /public_html/core/lib/Drupal/Core/DrupalKernel.php(713): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#10 /public_html/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#11 {main}

Downgrading to 9.1.27 has resolved this for now.

Drupal: 9.5.3
PHP: 8.1.14

🐛 Bug report
Status

Fixed

Version

9.2

Component

Code

Created by

🇬🇧United Kingdom Janner

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024