Index: wp-admin/includes/update.php
===================================================================
--- wp-admin/includes/update.php	(revision 6170)
+++ wp-admin/includes/update.php	(working copy)
@@ -82,7 +82,7 @@
 	$http_request .= "Host: api.wordpress.org\r\n";
 	$http_request .= "Content-Type: application/x-www-form-urlencoded; charset=" . get_option('blog_charset') . "\r\n";
 	$http_request .= "Content-Length: " . strlen($request) . "\r\n";
-	$http_request .= 'User-Agent: WordPress/' . $wp_version . '; ' . get_bloginfo('url') . "\r\n";
+	$http_request .= 'User-Agent: ' . wp_user_agent( Array( '(' . get_bloginfo('url') . ')' ) ) . "\r\n";
 	$http_request .= "\r\n";
 	$http_request .= $request;
 
Index: wp-admin/update-links.php
===================================================================
--- wp-admin/update-links.php	(revision 6170)
+++ wp-admin/update-links.php	(working copy)
@@ -18,7 +18,7 @@
 $http_request .= "Host: api.pingomatic.com\r\n";
 $http_request .= 'Content-Type: application/x-www-form-urlencoded; charset='.get_option('blog_charset')."\r\n";
 $http_request .= 'Content-Length: ' . strlen($query_string) . "\r\n";
-$http_request .= 'User-Agent: WordPress/' . $wp_version . "\r\n";
+$http_request .= 'User-Agent: ' . wp_user_agent() . "\r\n";
 $http_request .= "\r\n";
 $http_request .= $query_string;
 
Index: wp-includes/comment.php
===================================================================
--- wp-includes/comment.php	(revision 6170)
+++ wp-includes/comment.php	(working copy)
@@ -552,7 +552,7 @@
 		return false;
 
 	// Send the GET request
-	$request = "GET $path HTTP/1.1\r\nHost: $host\r\nUser-Agent: WordPress/$wp_version \r\n\r\n";
+	$request = "GET $path HTTP/1.1\r\nHost: $host\r\nUser-Agent: " . wp_user_agent() . "\r\n\r\n";
 	// ob_end_flush();
 	fputs($fp, $request);
 
@@ -778,7 +778,7 @@
 	$http_request .= 'Host: '.$trackback_url['host']."\r\n";
 	$http_request .= 'Content-Type: application/x-www-form-urlencoded; charset='.get_option('blog_charset')."\r\n";
 	$http_request .= 'Content-Length: '.strlen($query_string)."\r\n";
-	$http_request .= "User-Agent: WordPress/" . $wp_version;
+	$http_request .= "User-Agent: " . wp_user_agent();
 	$http_request .= "\r\n\r\n";
 	$http_request .= $query_string;
 	if ( '' == $trackback_url['port'] )
Index: wp-includes/functions.php
===================================================================
--- wp-includes/functions.php	(revision 6170)
+++ wp-includes/functions.php	(working copy)
@@ -529,6 +529,35 @@
 	endforeach;
 }
 
+/**
+ * This function generates a User-Agent string suitable for making HTTP
+ * requests with.
+ * @param {Array} $extra A hash with extra key/versions to include.
+ * @returns {String}
+ */
+function wp_user_agent( $extra='' ){
+    /* Notes:
+     * User-Agents are defined in RFC 1945 and RFC 2068.
+     * Approximately, they may only consist of alpha-numerics and
+     * periods and underlines.  Parenthesis enclose comments.
+     */
+    global $wp_version;
+    $parts = Array("WordPress/" . $wp_version);
+    if ( !empty($extra) ) {
+        foreach ( $extra as $key => $version ) {
+            if ( is_integer($key) ) {
+                /* No key part was provided, the Array is incrementing. */
+                array_push( $parts, $version );
+            } elseif ( empty($version) ) {
+                array_push( $parts, $key );
+            } else {
+                array_push( $parts, $key . '/' . $version );
+            }
+        }
+    }
+    return apply_filters('wp_user_agent', implode( ' ', $parts ));
+}
+
 function wp_get_http_headers( $url, $red = 1 ) {
 	global $wp_version;
 	@set_time_limit( 60 );
@@ -542,7 +571,7 @@
 	if ( !isset( $parts['port'] ) )
 		$parts['port'] = 80;
 
-	$head = "HEAD $file HTTP/1.1\r\nHOST: $host\r\nUser-Agent: WordPress/" . $wp_version . "\r\n\r\n";
+	$head = "HEAD $file HTTP/1.1\r\nHOST: $host\r\nUser-Agent: " . wp_user_agent() . "\r\n\r\n";
 
 	$fp = @fsockopen($host, $parts['port'], $err_num, $err_msg, 3);
 	if ( !$fp )
Index: wp-includes/rss.php
===================================================================
--- wp-includes/rss.php	(revision 6170)
+++ wp-includes/rss.php	(working copy)
@@ -11,7 +11,7 @@
 
 define('RSS', 'RSS');
 define('ATOM', 'Atom');
-define('MAGPIE_USER_AGENT', 'WordPress/' . $GLOBALS['wp_version']);
+define('MAGPIE_USER_AGENT', wp_user_agent());
 
 class MagpieRSS {
 	var $parser;
@@ -595,7 +595,7 @@
 	}
 
 	if ( !defined('MAGPIE_USER_AGENT') ) {
-		$ua = 'WordPress/' . $GLOBALS['wp_version'];
+		$ua = wp_user_agent();
 
 		if ( MAGPIE_CACHE_ON ) {
 			$ua = $ua . ')';
@@ -866,4 +866,4 @@
 }
 endif;
 
-?>
\ No newline at end of file
+?>
Index: wp-includes/update.php
===================================================================
--- wp-includes/update.php	(revision 6170)
+++ wp-includes/update.php	(working copy)
@@ -26,7 +26,7 @@
 	$http_request  = "GET /core/version-check/1.0/?version=$wp_version&php=$php_version&locale=$locale HTTP/1.0\r\n";
 	$http_request .= "Host: api.wordpress.org\r\n";
 	$http_request .= 'Content-Type: application/x-www-form-urlencoded; charset=' . get_option('blog_charset') . "\r\n";
-	$http_request .= 'User-Agent: WordPress/' . $wp_version . '; ' . get_bloginfo('url') . "\r\n";
+	$http_request .= 'User-Agent: ' . wp_user_agent( Array( '(' . get_bloginfo('url') . ')' ) ) . "\r\n";
 	$http_request .= "\r\n";
 
 	$response = '';
@@ -51,4 +51,4 @@
 
 add_action( 'init', 'wp_version_check' );
 
-?>
\ No newline at end of file
+?>
Index: wp-content/plugins/akismet/akismet.php
===================================================================
--- wp-content/plugins/akismet/akismet.php	(revision 19781)
+++ wp-content/plugins/akismet/akismet.php	(working copy)
@@ -165,7 +165,7 @@
 	$http_request .= "Host: $host\r\n";
 	$http_request .= "Content-Type: application/x-www-form-urlencoded; charset=" . get_option('blog_charset') . "\r\n";
 	$http_request .= "Content-Length: " . strlen($request) . "\r\n";
-	$http_request .= "User-Agent: WordPress/$wp_version | Akismet/2.0\r\n";
+	$http_request .= "User-Agent: " . wp_user_agent( Array( 'Akismet' => '2.0') ) . "\r\n";
 	$http_request .= "\r\n";
 	$http_request .= $request;
 
