WordPress.org

Make WordPress Core

Changeset 20159


Ignore:
Timestamp:
03/08/12 13:31:32 (3 years ago)
Author:
westi
Message:

XMLRPC: Start casting datatypes in _prepare_term so as to ensure consistent datatypes in our responses. See #18438.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/class-wp-xmlrpc-server.php

    r20158 r20159  
    518518            $_term = get_object_vars( $_term ); 
    519519 
     520        // For Intergers which may be largeer than XMLRPC supports ensure we return strings. 
     521        $_term['term_id'] = strval( $_term['term_id'] ); 
     522        $_term['term_group'] = strval( $_term['term_group'] ); 
     523        $_term['term_taxonomy_id'] = strval( $_term['term_taxonomy_id'] ); 
     524        $_term['parent'] = strval( $_term['parent'] ); 
     525 
     526        // Count we are happy to return as an Integer because people really shouldn't use Terms that much. 
     527        $_term['count'] = intval( $_term['count'] ); 
     528 
    520529        return apply_filters( 'xmlrpc__prepare_term', $_term, $term ); 
    521530    } 
Note: See TracChangeset for help on using the changeset viewer.