Make WordPress Core


Ignore:
Timestamp:
05/14/2011 07:45:07 PM (13 years ago)
Author:
nacin
Message:

Use wp_remote_retrieve_* helper functions instead of the raw HTTP response array. props aaroncampbell, fixes #17416.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/functions.php

    r17841 r17928  
    601601    wp_protect_special_option( $option );
    602602
    603     /* 
     603    /*
    604604     * FIXME the next two lines of code are not necessary and should be removed.
    605605     * @see http://core.trac.wordpress.org/ticket/13480
     
    13061306
    13071307    $headers = wp_remote_retrieve_headers( $response );
    1308     $headers['response'] = $response['response']['code'];
     1308    $headers['response'] = wp_remote_retrieve_response_code( $response );
    13091309
    13101310    // WP_HTTP no longer follows redirects for HEAD requests.
     
    13211321        return $headers;
    13221322
    1323     fwrite( $out_fp,  $response['body']);
     1323    fwrite( $out_fp,  wp_remote_retrieve_body( $response ) );
    13241324    fclose($out_fp);
    13251325    clearstatcache();
     
    15571557        return false;
    15581558
    1559     return $response['body'];
     1559    return wp_remote_retrieve_body( $response );
    15601560}
    15611561
     
    28772877 * @param string|array $args Optional arguements to control behaviour.
    28782878 */
    2879 function _xmlrpc_wp_die_handler( $message, $title = '', $args = array() ) { 
     2879function _xmlrpc_wp_die_handler( $message, $title = '', $args = array() ) {
    28802880    global $wp_xmlrpc_server;
    28812881    $defaults = array( 'response' => 500 );
     
    28832883    $r = wp_parse_args($args, $defaults);
    28842884
    2885     if ( $wp_xmlrpc_server ) { 
    2886         $error = new IXR_Error( $r['response'] , $message); 
    2887         $wp_xmlrpc_server->output( $error->getXml() ); 
     2885    if ( $wp_xmlrpc_server ) {
     2886        $error = new IXR_Error( $r['response'] , $message);
     2887        $wp_xmlrpc_server->output( $error->getXml() );
    28882888    }
    28892889    die();
     
    28922892/**
    28932893 * Filter to enable special wp_die handler for xmlrpc requests.
    2894  * 
     2894 *
    28952895 * @since 3.2.0
    28962896 * @access private
    28972897 */
    2898 function _xmlrpc_wp_die_filter() { 
     2898function _xmlrpc_wp_die_filter() {
    28992899    return '_xmlrpc_wp_die_handler';
    29002900}
Note: See TracChangeset for help on using the changeset viewer.