WordPress.org

Make WordPress Core

Opened 5 months ago

Last modified 5 months ago

#49478 new defect (bug)

get_post_type_object has the wrong type of validator for its parameter

Reported by: kamilkecki Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 5.3.2
Component: Posts, Post Types Keywords: has-patch needs-testing 2nd-opinion
Focuses: Cc:

Description

https://core.trac.wordpress.org/browser/tags/5.3/src/wp-includes/post.php?rev=46727#L1228

get_post_type_object expects a post type as a string as its parameter, however it checks if the parameter is scalar or not and returns null if it is not a number.

Attachments (1)

49748.diff (582 bytes) - added by sebastienserre 5 months ago.
Change type of check to be sure params is a string

Download all attachments as: .zip

Change History (3)

#1 @SergeyBiryukov
5 months ago

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

Just adding a link to the related changeset here: [34100] / #30013.

@sebastienserre
5 months ago

Change type of check to be sure params is a string

#2 @sebastienserre
5 months ago

  • Keywords has-patch needs-testing 2nd-opinion added; needs-patch removed
Note: See TracTickets for help on using tickets.