Deprecated notice in PHP 8.2 – stripos
Hi,
I’m getting a deprecated notice in Query Monitor related to BeTheme when running PHP 8.2.
Here’s the full message:
stripos(): Passing null to parameter #1 ($haystack) of type string is deprecated
wp-includes/functions.wp-styles.php:90
The stack trace shows that the warning originates from:
wp_add_inline_style()
→ /wp-content/themes/betheme/functions/theme-head.php:714
→ mfn_styles_inline()
It looks like mfn_styles_inline() sometimes returns null, which is then passed to wp_add_inline_style().
Starting from PHP 8.1, passing null to stripos() triggers this deprecated warning.
Could you please check this and update the function so it always returns a string (even an empty one),
or add a safeguard before calling wp_add_inline_style()?
Thanks a lot for your help
Comments
Hi,
I have passed it on to the dev team, and we are reviewing this.
Best regards