Don't return early before filtering.
git-svn-id: http://svn.automattic.com/wordpress/trunk@7161 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
0e9ffe90bb
commit
e6b01542a5
|
@ -725,13 +725,9 @@ function sanitize_post($post, $context = 'display') {
|
||||||
if ( 'raw' == $context )
|
if ( 'raw' == $context )
|
||||||
return $post;
|
return $post;
|
||||||
if ( is_object($post) ) {
|
if ( is_object($post) ) {
|
||||||
if ( !isset($post->ID) )
|
|
||||||
return $post;
|
|
||||||
foreach ( array_keys(get_object_vars($post)) as $field )
|
foreach ( array_keys(get_object_vars($post)) as $field )
|
||||||
$post->$field = sanitize_post_field($field, $post->$field, $post->ID, $context);
|
$post->$field = sanitize_post_field($field, $post->$field, $post->ID, $context);
|
||||||
} else {
|
} else {
|
||||||
if ( !isset($post['ID']) )
|
|
||||||
return $post;
|
|
||||||
foreach ( array_keys($post) as $field )
|
foreach ( array_keys($post) as $field )
|
||||||
$post[$field] = sanitize_post_field($field, $post[$field], $post['ID'], $context);
|
$post[$field] = sanitize_post_field($field, $post[$field], $post['ID'], $context);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue