Make WordPress Core

Opened 10 months ago

Last modified 10 months ago

#58954 new defect (bug)

php 8.1 preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated

Reported by: twentyzerotwo's profile TwentyZeroTwo Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 6.2.2
Component: General Keywords:
Focuses: Cc:

Description

Encountered when editing a page at /wp-admin/post.php?post=2&action=edit

On line 6811 of wp-includes/post.php

 $ext     = preg_replace( '/^.+?\.([^.]+)$/', '$1', $file );

I found a lot of these tickets on trac, but couldnt find any for this specific instance.

Change History (2)

#1 @rajinsharwar
10 months ago

Hi @TwentyZeroTwo, can you try to remove, and re-attach the any attachments in the post?

#2 @TwentyZeroTwo
10 months ago

I can indeed, but surely the underlying deprecation error should be corrected?

Note: See TracTickets for help on using tickets.