Opened 8 years ago
Closed 8 years ago
#37400 closed defect (bug) (invalid)
Filter in wp_object_type_exists allows for fatal error
Reported by: | chriscct7 | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | Options, Meta APIs | Keywords: | needs-patch |
Focuses: | Cc: |
Description
In the wp_object_type_exists filter, if a person removes all of the object types, and returns and empty string or false, a fatal error will occur at the if statement, as it does not check to see if the data contained in the variable is empty or an array first.
function wp_object_type_exists( $object_type ) { /** * Filters WordPress object types. * * @since 4.6.0 * * @param array $types Array of object types. */ $types = apply_filters( 'wp_object_types', array( 'post', 'comment', 'user', 'term' ) ); if ( in_array( $object_type, $types ) ) { return true; } return false; }
Change History (2)
Note: See
TracTickets for help on using
tickets.
The latest patch on #35658 will remove that function.