WordPress.org

Make WordPress Core

Ticket #8660: 8660.2.diff

File 8660.2.diff, 1.5 KB (added by DD32, 9 years ago)

Adds blog url back into user agent for update-requests.

  • wp-includes/update.php

     
    4949        $local_package = isset( $wp_local_package )? $wp_local_package : '';
    5050        $url = "http://api.wordpress.org/core/version-check/1.3/?version=$wp_version&php=$php_version&locale=$locale&mysql=$mysql_version&local_package=$local_package";
    5151
    52         $options = array('timeout' => 3);
     52        $options = array(
     53                'timeout' => 3,
     54                'user-agent' => 'WordPress/' . $wp_version . '; ' . get_bloginfo( 'url' )
     55        );
    5356
    5457        $response = wp_remote_get($url, $options);
    5558
     
    145148        update_option( 'update_plugins', $current );
    146149
    147150        $to_send = (object)compact('plugins', 'active');
    148         $body = array('plugins' => serialize( $to_send ) );
    149151
    150         $options = array('timeout' => 3, 'body' => $body);
     152        $options = array(
     153                'timeout' => 3,
     154                'body' => array( 'plugins' => serialize( $to_send ) ),
     155                'user-agent' => 'WordPress/' . $wp_version . '; ' . get_bloginfo( 'url' )
     156        );
    151157
    152158        $raw_response = wp_remote_post('http://api.wordpress.org/plugins/update-check/1.0/', $options);
    153159
     
    218224
    219225        $options = array(
    220226                'timeout'               => 3,
    221                 'body'                  => array( 'themes' => serialize( $themes ) )
     227                'body'                  => array( 'themes' => serialize( $themes ) ),
     228                'user-agent'    => 'WordPress/' . $wp_version . '; ' . get_bloginfo( 'url' )
    222229        );
    223230
    224231        $raw_response = wp_remote_post( 'http://api.wordpress.org/themes/update-check/1.0/', $options );