Custom Body Class triggers PHP 8.2 warning: Deprecated function: preg_match(): Passing null to parameter #2

Created on 29 March 2024, 9 months ago
Updated 6 August 2024, 5 months ago

Problem/Motivation

Getting this:
Deprecated function: preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated in custom_body_class_node_special_character_form_validate() (line 121 of modules/contrib/custom_body_class/custom_body_class.module).

Steps to reproduce

Install the Custom Body Class module and use it.

Proposed resolution

Add NULL checks to vars before passing to preg_match()

๐Ÿ› Bug report
Status

RTBC

Version

2.0

Component

Code

Created by

๐Ÿ‡ฆ๐Ÿ‡บAustralia jaydee1818 Melbourne

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

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

Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024