[D7 PHP 8.1] html_entity_decode(): Passing null to parameter #1 ($string) of type string is deprecated in decode_entities()

Created on 24 October 2023, about 1 year ago
Updated 5 December 2023, 12 months ago

Problem/Motivation

We are experiencing multiple deprecation warnings on PHP 8.1 in the decode_entities() function:

Deprecated function: html_entity_decode(): Passing null to parameter #1 ($string) of type string is deprecated in decode_entities() (line 463 of includes/unicode.inc).

I'm posting this as prior art 🐛 [D7 PHP 8.1] strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in text_summary() Fixed . I've been posting issues on the originating modules to solve this but it's coming from the same source in core.

Steps to reproduce

Proposed resolution

Cast the input as a string.

🐛 Bug report
Status

Fixed

Version

7.0 ⚰️

Component
Base 

Last updated about 5 hours ago

Created by

🇨🇦Canada joelpittet Vancouver

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024