Skip sanitization altogether for raw context. Props Quandary. fixes #5325
git-svn-id: http://svn.automattic.com/wordpress/trunk@6321 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
1e320a469e
commit
964c6c72c1
|
@ -409,6 +409,10 @@ function get_post_custom_values( $key = '', $post_id = 0 ) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function sanitize_post($post, $context = 'display') {
|
function sanitize_post($post, $context = 'display') {
|
||||||
|
|
||||||
|
if ( 'raw' == $context )
|
||||||
|
return $post;
|
||||||
|
|
||||||
// TODO: Use array keys instead of hard coded list
|
// TODO: Use array keys instead of hard coded list
|
||||||
$fields = array('post_author', 'post_date', 'post_date_gmt', 'post_content', 'post_content_filtered', 'post_title', 'post_excerpt', 'post_status', 'post_type', 'comment_status', 'ping_status', 'post_password', 'post_name', 'to_ping', 'pinged', 'post_date', 'post_date_gmt', 'post_parent', 'menu_order', 'post_mime_type', 'post_category');
|
$fields = array('post_author', 'post_date', 'post_date_gmt', 'post_content', 'post_content_filtered', 'post_title', 'post_excerpt', 'post_status', 'post_type', 'comment_status', 'ping_status', 'post_password', 'post_name', 'to_ping', 'pinged', 'post_date', 'post_date_gmt', 'post_parent', 'menu_order', 'post_mime_type', 'post_category');
|
||||||
|
|
||||||
|
|
|
@ -734,6 +734,10 @@ function is_term($term, $taxonomy = '') {
|
||||||
* @return array|object Term with all fields sanitized
|
* @return array|object Term with all fields sanitized
|
||||||
*/
|
*/
|
||||||
function sanitize_term($term, $taxonomy, $context = 'display') {
|
function sanitize_term($term, $taxonomy, $context = 'display') {
|
||||||
|
|
||||||
|
if ( 'raw' == $context )
|
||||||
|
return $term;
|
||||||
|
|
||||||
$fields = array('term_id', 'name', 'description', 'slug', 'count', 'parent', 'term_group');
|
$fields = array('term_id', 'name', 'description', 'slug', 'count', 'parent', 'term_group');
|
||||||
|
|
||||||
$do_object = false;
|
$do_object = false;
|
||||||
|
|
Loading…
Reference in New Issue