Deprecated function error

Created on 2 June 2022, over 2 years ago
Updated 31 May 2024, 6 months ago

Problem/Motivation

Hi,

I am getting this error after user logs in and has to accept Legal terms.

Deprecated function: strlen(): Passing null to parameter #1 ($string) of type string is deprecated in Drupal\Component\Utility\Unicode::validateUtf8() (line 478 of core/lib/Drupal/Component/Utility/Unicode.php).

And

Deprecated function: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in Drupal\Component\Utility\Xss::filter() 
(line 69 of /var/www/html/site/web/core/lib/Drupal/Component/Utility/Xss.php)

#0 /var/www/html/site/web/core/includes/bootstrap.inc(346): _drupal_error_handler_real()
#1 [internal function]: _drupal_error_handler()
#2 /var/www/html/site/web/core/lib/Drupal/Component/Utility/Xss.php(69): str_replace()
#3 /var/www/html/site/web/core/lib/Drupal/Component/Utility/Xss.php(123): Drupal\Component\Utility\Xss::filter()
#4 /var/www/html/site/web/modules/contrib/legal/legal.module(757): Drupal\Component\Utility\Xss::filterAdmin()
#5 /var/www/html/site/web/modules/contrib/legal/src/Form/LegalLogin.php(145): legal_display_changes()
#6 [internal function]: Drupal\legal\Form\LegalLogin->buildForm()

I guess the problem came after jumping from php 7.4 to PHP 8.1

It is a similar error as this:
https://www.drupal.org/project/diff/issues/3256598

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Fixed

Version

3.0

Component

Code

Created by

🇫🇮Finland jukka792

Live updates comments and jobs are added and updated live.
  • PHP 8.1

    The issue particularly affects sites running on PHP version 8.1.0 or later.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024