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

Created on 29 March 2024, 3 months ago
Updated 3 April 2024, 3 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.69.0 2024