### Eclipse Workspace Patch 1.0 #P drupal Index: includes/xmlrpc.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/xmlrpc.inc,v retrieving revision 1.48 diff -u -r1.48 xmlrpc.inc --- includes/xmlrpc.inc 15 Mar 2008 12:59:22 -0000 1.48 +++ includes/xmlrpc.inc 12 Apr 2008 22:33:23 -0000 @@ -425,6 +425,7 @@ * A $xmlrpc_message object if the call succeeded; FALSE if the call failed */ function _xmlrpc() { + global $db_prefix, $simpletest_ua_key; $args = func_get_args(); $url = array_shift($args); if (is_array($args[0])) { @@ -439,7 +440,14 @@ $method = array_shift($args); } $xmlrpc_request = xmlrpc_request($method, $args); - $result = drupal_http_request($url, array("Content-Type" => "text/xml"), 'POST', $xmlrpc_request->xml); + + // Use SimpleTest User-Agent to pass database prefix. + if (preg_match("/^simpletest\d+/", $db_prefix)) { + $result = drupal_http_request($url, array("Content-Type" => "text/xml", "User-Agent" => "$db_prefix,$simpletest_ua_key"), 'POST', $xmlrpc_request->xml); + } + else { + $result = drupal_http_request($url, array("Content-Type" => "text/xml"), 'POST', $xmlrpc_request->xml); + } if ($result->code != 200) { xmlrpc_error($result->code, $result->error); return FALSE;