From cd40c68bd83d189f4a98ce2ee155c28bcf17562d Mon Sep 17 00:00:00 2001 From: Peter Westwood Date: Thu, 8 Mar 2012 13:31:32 +0000 Subject: [PATCH] XMLRPC: Start casting datatypes in _prepare_term so as to ensure consistent datatypes in our responses. See #18438. git-svn-id: https://develop.svn.wordpress.org/trunk@20159 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/class-wp-xmlrpc-server.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/wp-includes/class-wp-xmlrpc-server.php b/wp-includes/class-wp-xmlrpc-server.php index 277cb39de3..df8ba6b3e3 100644 --- a/wp-includes/class-wp-xmlrpc-server.php +++ b/wp-includes/class-wp-xmlrpc-server.php @@ -517,6 +517,15 @@ class wp_xmlrpc_server extends IXR_Server { if ( ! is_array( $_term) ) $_term = get_object_vars( $_term ); + // For Intergers which may be largeer than XMLRPC supports ensure we return strings. + $_term['term_id'] = strval( $_term['term_id'] ); + $_term['term_group'] = strval( $_term['term_group'] ); + $_term['term_taxonomy_id'] = strval( $_term['term_taxonomy_id'] ); + $_term['parent'] = strval( $_term['parent'] ); + + // Count we are happy to return as an Integer because people really shouldn't use Terms that much. + $_term['count'] = intval( $_term['count'] ); + return apply_filters( 'xmlrpc__prepare_term', $_term, $term ); }