Undefined Variable in `mt_setPostCategories()`
|Reported by:||ericmann||Owned by:||ryan|
This will likely only ever come up if WP_DEBUG is set to true, but we're attempting to add elements to an array inside a foreach without first creating the array. We then pass a potentially non-existent object along to wp_set_post_categories().
This creates a PHP notice that, if WP_DEBUG is turned on with the server, breaks the document returned to XML-RPC clients attempting to use mt.setPostCategories to update categories.
The fix is simple. Just create an empty array before trying to add elements to it or passing it out of the function.
Change History (5)
comment:1 SergeyBiryukov — 13 months ago
- Keywords commit added
- Milestone changed from Awaiting Review to 3.5