From 5cd77fdb99b4c223bbbfcb86a99ab73845ead9fb Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Thu, 28 Feb 2013 19:40:26 +0000 Subject: [PATCH] Revert [23359]. The post_author and comment_count post object fields will remain numeric strings for back compat. see #22324. git-svn-id: http://core.svn.wordpress.org/trunk@23531 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/class-wp-xmlrpc-server.php | 20 ++++++++++---------- wp-includes/post.php | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/wp-includes/class-wp-xmlrpc-server.php b/wp-includes/class-wp-xmlrpc-server.php index b42dddbb62..d6ee2a1323 100644 --- a/wp-includes/class-wp-xmlrpc-server.php +++ b/wp-includes/class-wp-xmlrpc-server.php @@ -624,7 +624,7 @@ class wp_xmlrpc_server extends IXR_Server { 'post_status' => $post['post_status'], 'post_type' => $post['post_type'], 'post_name' => $post['post_name'], - 'post_author' => (string) $post['post_author'], + 'post_author' => $post['post_author'], 'post_password' => $post['post_password'], 'post_excerpt' => $post['post_excerpt'], 'post_content' => $post['post_content'], @@ -806,7 +806,7 @@ class wp_xmlrpc_server extends IXR_Server { $_page = array( 'dateCreated' => $page_date, - 'userid' => (string) $page->post_author, + 'userid' => $page->post_author, 'page_id' => $page->ID, 'page_status' => $page->post_status, 'description' => $full_page['main'], @@ -3647,10 +3647,10 @@ class wp_xmlrpc_server extends IXR_Server { $content .= $post_data['post_content']; $struct = array( - 'userid' => (string) $post_data['post_author'], + 'userid' => $post_data['post_author'], 'dateCreated' => $this->_convert_date( $post_data['post_date'] ), 'content' => $content, - 'postid' => (string) $post_data['ID'] + 'postid' => (string) $post_data['ID'] ); return $struct; @@ -3698,10 +3698,10 @@ class wp_xmlrpc_server extends IXR_Server { $content .= $entry['post_content']; $struct[] = array( - 'userid' => (string) $entry['post_author'], + 'userid' => $entry['post_author'], 'dateCreated' => $post_date, - 'content' => $content, - 'postid' => (string) $entry['ID'], + 'content' => $content, + 'postid' => (string) $entry['ID'], ); } @@ -4570,7 +4570,7 @@ class wp_xmlrpc_server extends IXR_Server { $resp = array( 'dateCreated' => $post_date, - 'userid' => (string) $postdata['post_author'], + 'userid' => $postdata['post_author'], 'postid' => $postdata['ID'], 'description' => $post['main'], 'title' => $postdata['post_title'], @@ -4681,7 +4681,7 @@ class wp_xmlrpc_server extends IXR_Server { $struct[] = array( 'dateCreated' => $post_date, - 'userid' => (string) $entry['post_author'], + 'userid' => $entry['post_author'], 'postid' => (string) $entry['ID'], 'description' => $post['main'], 'title' => $entry['post_title'], @@ -4896,7 +4896,7 @@ class wp_xmlrpc_server extends IXR_Server { $struct[] = array( 'dateCreated' => $post_date, - 'userid' => (string) $entry['post_author'], + 'userid' => $entry['post_author'], 'postid' => (string) $entry['ID'], 'title' => $entry['post_title'], 'post_status' => $entry['post_status'], diff --git a/wp-includes/post.php b/wp-includes/post.php index 052e75f27d..658e43ea96 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -1976,7 +1976,7 @@ function sanitize_post($post, $context = 'display') { * @return mixed Sanitized value. */ function sanitize_post_field($field, $value, $post_id, $context) { - $int_fields = array('ID', 'post_parent', 'menu_order', 'post_author', 'comment_count'); + $int_fields = array('ID', 'post_parent', 'menu_order'); if ( in_array($field, $int_fields) ) $value = (int) $value;