From 3330c693e4cd9ab6d14c928fd1dd662d7bb63dde Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Wed, 7 Nov 2007 06:20:08 +0000 Subject: [PATCH] Skip sanitization altogether for raw context. Props Quandary. fixes #5325 git-svn-id: https://develop.svn.wordpress.org/trunk@6321 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/post.php | 4 ++++ wp-includes/taxonomy.php | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/wp-includes/post.php b/wp-includes/post.php index 18256d4834..b32a4ee1fd 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -409,6 +409,10 @@ function get_post_custom_values( $key = '', $post_id = 0 ) { } function sanitize_post($post, $context = 'display') { + + if ( 'raw' == $context ) + return $post; + // 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'); diff --git a/wp-includes/taxonomy.php b/wp-includes/taxonomy.php index 5121794277..2826a3fff0 100644 --- a/wp-includes/taxonomy.php +++ b/wp-includes/taxonomy.php @@ -734,6 +734,10 @@ function is_term($term, $taxonomy = '') { * @return array|object Term with all fields sanitized */ function sanitize_term($term, $taxonomy, $context = 'display') { + + if ( 'raw' == $context ) + return $term; + $fields = array('term_id', 'name', 'description', 'slug', 'count', 'parent', 'term_group'); $do_object = false;