mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-02-25 18:22:44 +00:00
sanitize_post() is polymorphic, add an is_array() check for $post before operating on it as an array.
Props morganestes. Fixes #33118. git-svn-id: https://develop.svn.wordpress.org/trunk@34080 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
250c8a0224
commit
0b8101849e
@ -1814,7 +1814,7 @@ function sanitize_post( $post, $context = 'display' ) {
|
||||
foreach ( array_keys(get_object_vars($post)) as $field )
|
||||
$post->$field = sanitize_post_field($field, $post->$field, $post->ID, $context);
|
||||
$post->filter = $context;
|
||||
} else {
|
||||
} elseif ( is_array( $post ) ) {
|
||||
// Check if post already filtered for this context.
|
||||
if ( isset($post['filter']) && $context == $post['filter'] )
|
||||
return $post;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user