Site logo

Archived topic

PHP 8.1 deprecated warning preg_replace

11 replies · Started by Jarko on February 18, 2023

Viewing posts 1–12 of 12

6.2-beta2 PHP 8.1
Generate press theme 3.2.4

http://localhost/wp/wp-admin/nav-menus.php

Gives following PHP warning (when debug is enabled)

Deprecated: preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /public_html/blog/wp-admin/includes/plugin.php on line 2088

Also http://localhost/wp/wp-admin/customize.php gives:


Deprecated: stripos(): Passing null to parameter #1 ($haystack) of type string is deprecated in C:\xampp\htdocs\wp\wp-includes\functions.wp-styles.php on line 90

When using Disable Elements in the GP premium Version 2.2.2

Thanks for reporting this, we will look into this.

Any update on this issue? Still in GP Premium Version 2.3.0-rc.2 with WP 6.2 RC3 on PHP 8.2

wp-admin/nav-menus.php
Deprecated: preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in C:\xampp\htdocs\test\wp-admin\includes\plugin.php on line 2088

Thanks!

Oh, looks like that slipped through.
I assume the other stripos warning has gone ?

Ill get the original issue sorted asap. Might be able to squeeze it in this update.

Cant reproduce the other warning, so not sure. but wp-admin/nav-menus.php is easy to reproduce. Would be great if fixed. Thanks!

Yeah - that was my mistake i only prioritised the second issue. We'll take a look at the first!!

OK, so excuse the back and forth - we took a closer look at the first issue. And it looks to be a core issue.
Can you check if it appears on your site without GPP and a different theme ?

Isn't nav-menus.php GP specific? As Twenty Twenty-Three Version: 1.1 don't have nav-menus.php

Could it be same as the problem in https://core.trac.wordpress.org/ticket/57580

In WP 6.2 RC 3 WordPress has cleaned many PHP warnings for 8.2

Thanks!

the nav-menus.php is a core template for the menus admin screen. And i am pretty sure we don't write any data to that.
Does the issue still show when GP Premium is disabled ?

Yes looks like its core code. Made ticket https://core.trac.wordpress.org/ticket/57974#ticket
Yes when GP Premium is disabled it still exist. Don't know another theme that use nav-menus.php as Tried "Twenty Twenty-Three Version: 1.1" but it gives "with Your theme does not support navigation menus or widgets."

Twenty23 is a block based theme so its using a block template for its header and nav, which may be why.
Looks like core has a fix ready for 6.2.1

This archived topic is closed to new replies.