Set the user-agent like we did before. See #8660

git-svn-id: https://develop.svn.wordpress.org/trunk@10238 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Peter Westwood 2008-12-21 21:52:15 +00:00
parent 94b9733dff
commit 541a75aedf
1 changed files with 11 additions and 4 deletions

View File

@ -49,7 +49,10 @@ function wp_version_check() {
$local_package = isset( $wp_local_package )? $wp_local_package : '';
$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";
$options = array('timeout' => 3);
$options = array(
'timeout' => 3,
'user-agent' => 'WordPress/' . $wp_version . '; ' . get_bloginfo( 'url' )
);
$response = wp_remote_get($url, $options);
@ -145,9 +148,12 @@ function wp_update_plugins() {
update_option( 'update_plugins', $current );
$to_send = (object)compact('plugins', 'active');
$body = array('plugins' => serialize( $to_send ) );
$options = array('timeout' => 3, 'body' => $body);
$options = array(
'timeout' => 3,
'body' => array( 'plugins' => serialize( $to_send ) ),
'user-agent' => 'WordPress/' . $wp_version . '; ' . get_bloginfo( 'url' )
);
$raw_response = wp_remote_post('http://api.wordpress.org/plugins/update-check/1.0/', $options);
@ -218,7 +224,8 @@ function wp_update_themes( ) {
$options = array(
'timeout' => 3,
'body' => array( 'themes' => serialize( $themes ) )
'body' => array( 'themes' => serialize( $themes ) ),
'user-agent' => 'WordPress/' . $wp_version . '; ' . get_bloginfo( 'url' )
);
$raw_response = wp_remote_post( 'http://api.wordpress.org/themes/update-check/1.0/', $options );