Opened 3 years ago
Last modified 3 years ago
#58246 new defect (bug)
'update_meta_cache()' doesn't correctly handle the return value of the 'update_{$meta_type}_metadata_cache' filter
| Reported by: | donglijun | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Awaiting Review |
| Component: | Options, Meta APIs | Version: | 6.3 |
| Severity: | normal | Keywords: | has-patch |
| Cc: | Focuses: |
Description
The return type of update_meta_cache() is array or false, but the return value of update_{$meta_type}_metadata_cache filter is forcibly cast to bool and returned in update_meta_cache().
wp-includes/meta.php: 1149
$check = apply_filters( "update_{$meta_type}_metadata_cache", null, $object_ids ); if ( null !== $check ) { return (bool) $check; }
This may cause get_metadata_raw() to produce incorrect results.
wp-includes/meta.php: 646
if ( ! $meta_cache ) { $meta_cache = update_meta_cache( $meta_type, array( $object_id ) ); if ( isset( $meta_cache[ $object_id ] ) ) { $meta_cache = $meta_cache[ $object_id ]; } else { $meta_cache = null; } }
Attachments (1)
Change History (2)
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)