Opened 16 years ago
Closed 15 years ago
#7014 closed defect (bug) (invalid)
get_post_custom() doesn't always return an array
Reported by: | donncha | Owned by: | |
---|---|---|---|
Milestone: | Priority: | high | |
Severity: | normal | Version: | 2.5.1 |
Component: | General | Keywords: | 2nd-opinion |
Focuses: | Cc: |
Description
I have noticed that get_post_custom() doesn't always return an array. wp-includes/feed.php uses this function in a foreach loop at line 164 in WP 2.5.1 resulting in an error message stating "Invalid argument supplied for foreach() in ...wp-includes/feed.php on line 164"
I think update_postmeta_cache() in wp-includes/post.php should cast it's return value as an array possibly.
Change History (6)
Note: See
TracTickets for help on using
tickets.
Casting the return of get_post_custom() as an array fixes this problem.