Ticket #7014 (new defect (bug))

Opened 8 months ago

Last modified 6 months ago

get_post_custom() doesn't always return an array

Reported by: donncha Assigned to: anonymous
Priority: normal Milestone: 2.9
Component: General Version: 2.5.1
Severity: normal Keywords:
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

05/21/08 16:15:37 changed by donncha

Casting the return of get_post_custom() as an array fixes this problem.

07/15/08 16:24:07 changed by ryan

  • milestone changed from 2.5.2 to 2.9.

Milestone 2.5.2 deleted