From c55feaddbfc4a496423bb8877756bfe8d772288e Mon Sep 17 00:00:00 2001 From: westi Date: Sun, 21 Dec 2008 21:52:15 +0000 Subject: [PATCH] Set the user-agent like we did before. See #8660 git-svn-id: http://svn.automattic.com/wordpress/trunk@10238 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/update.php | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/wp-includes/update.php b/wp-includes/update.php index e5c42d243f..bd37647eeb 100644 --- a/wp-includes/update.php +++ b/wp-includes/update.php @@ -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 );