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:
matt 2008-03-05 18:49:56 +00:00
parent 0e9ffe90bb
commit e6b01542a5

View File

@ -725,13 +725,9 @@ function sanitize_post($post, $context = 'display') {
if ( 'raw' == $context )
return $post;
if ( is_object($post) ) {
if ( !isset($post->ID) )
return $post;
foreach ( array_keys(get_object_vars($post)) as $field )
$post->$field = sanitize_post_field($field, $post->$field, $post->ID, $context);
} else {
if ( !isset($post['ID']) )
return $post;
foreach ( array_keys($post) as $field )
$post[$field] = sanitize_post_field($field, $post[$field], $post['ID'], $context);
}