Make WordPress Core

Opened 14 months ago

Closed 14 months ago

Last modified 13 months ago

#58066 closed defect (bug) (duplicate)

PHP Deprecated: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated

Reported by: ebai4's profile ebai4 Owned by:
Milestone: Priority: normal
Severity: normal Version: 6.2
Component: Formatting Keywords: php81
Focuses: Cc:

Description (last modified by sabernhardt)

WP version : 6.2
PHP: 8.1.9

After updating to PHP 8.1.9 I get this error, even with no active plugins and with the Twenty Twenty-Three theme on.

PHP Deprecated: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in xxxxxxxx\wp-includes\formatting.php on line 4280

Change History (6)

#1 @sabernhardt
14 months ago

  • Component changed from General to Formatting
  • Description modified (diff)
  • Keywords php81 added

#2 @sajjad67
14 months ago

With fresh installation of WordPress 6.2 with nothing enabled but only Twenty Twenty-Three theme doesn't give any error for PHP v8.1.19 or v8.1.13 or even v8.2.x

I am not sure how you are getting this warning, can you please describe how we can recreate the issue? Maybe it's an issue on your end machine only.

#3 @tijmensmit
14 months ago

I have the same issue with PHP v8.1.20

It looks like you get this error ( at least in my case ) when no author is assigned to a post.

I see it on the post overview page for a store locator plugin in the author column ( no author name is visible, just the error ). The post data is imported from a CSV file, so the post is not manually created.

When I open a post where this error shows up and save it, so it's assigned to an author, the error is gone.

Last edited 14 months ago by tijmensmit (previous) (diff)

#4 @ebai4
14 months ago

  • Resolution set to worksforme
  • Status changed from new to closed

You're right tijmensmit. In my case, it looks like the user who originally created the page was deleted therefore some pages didn't have an author. Assigning an author to the page solves it. Thanks!

#5 @SergeyBiryukov
13 months ago

  • Resolution changed from worksforme to duplicate

Hi there, welcome to WordPress Trac! Thanks for the ticket.

This ticket was submitted earlier, but #58157 ended up having more discussion with further details.

This should now be resolved for WordPress 6.3 in [55755].

#6 @SergeyBiryukov
13 months ago

  • Milestone Awaiting Review deleted
Note: See TracTickets for help on using tickets.