Index: includes/xmlrpc.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/xmlrpc.inc,v
retrieving revision 1.47.2.5
diff -u -p -r1.47.2.5 xmlrpc.inc
--- includes/xmlrpc.inc	14 Jan 2009 21:36:16 -0000	1.47.2.5
+++ includes/xmlrpc.inc	29 Dec 2009 21:47:01 -0000
@@ -67,10 +67,10 @@ function xmlrpc_value_calculate_type(&$x
     return empty($xmlrpc_value->data) || range(0, count($xmlrpc_value->data) - 1) === array_keys($xmlrpc_value->data) ? 'array' : 'struct';
   }
   if (is_object($xmlrpc_value->data)) {
-    if ($xmlrpc_value->data->is_date) {
+    if (isset($xmlrpc_value->data->is_date)) {
       return 'date';
     }
-    if ($xmlrpc_value->data->is_base64) {
+    if (isset($xmlrpc_value->data->is_base64)) {
       return 'base64';
     }
     $xmlrpc_value->data = get_object_vars($xmlrpc_value->data);
@@ -420,11 +420,31 @@ function xmlrpc_base64_get_xml($xmlrpc_b
 }
 
 /**
- * Execute an XML remote procedural call. This is private function; call xmlrpc()
- * in common.inc instead of this function.
+ * Performs one or more XML-RPC request(s).
  *
+ * This is a private function; call xmlrpc() in common.inc instead of this 
+ * function.
+ *
+ * @param $url
+ *   An absolute URL of the XML-RPC endpoint.
+ *     Example:
+ *     http://www.example.com/xmlrpc.php
+ * @param ...
+ *   For one request:
+ *     The method name followed by a variable number of arguments to the method.
+ *   For multiple requests (system.multicall):
+ *     An array of call arrays. Each call array follows the pattern of the single
+ *     request: method name followed by the arguments to the method.
  * @return
- *   A $xmlrpc_message object if the call succeeded; FALSE if the call failed
+ *   Either the return value of the method on success, or FALSE.  If FALSE is
+ *   returned, see xmlrpc_errno() and xmlrpc_error_msg().
+ *   - For a non-multicall request: the result just as if this had been a local
+ *     function call.
+ *   - For a multicall request: an array of results. Each result will either be
+ *     a one-element array containing the result returned by the method called,
+ *     or an xmlrpc_error object if the call failed.
+ *
+ * @see xmlrpc_error()
  */
 function _xmlrpc() {
   $args = func_get_args();
@@ -442,7 +462,8 @@ function _xmlrpc() {
     $method = array_shift($args);
   }
   $xmlrpc_request = xmlrpc_request($method, $args);
-  $result = drupal_http_request($url, array("Content-Type" => "text/xml"), 'POST', $xmlrpc_request->xml);
+  $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;
@@ -459,8 +480,23 @@ function _xmlrpc() {
     xmlrpc_error($message->fault_code, $message->fault_string);
     return FALSE;
   }
-  // Message must be OK
-  return $message->params[0];
+  // We now know that the message is well-formed and a non-fault result.
+  if ($method == 'system.multicall') {
+    // Return per-method results or error objects.
+    $return = array();
+    foreach ($message->params[0] as $result) {
+      if (array_keys($result) == array(0)) {
+        $return[] = $result[0];
+      }
+      else {
+        $return[] = xmlrpc_error($result['faultCode'], $result['faultString']);
+      }
+    }
+  }
+  else {
+    $return = $message->params[0];
+  }
+  return $return;
 }
 
 /**
Index: includes/xmlrpcs.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/xmlrpcs.inc,v
retrieving revision 1.24.2.3
diff -u -p -r1.24.2.3 xmlrpcs.inc
--- includes/xmlrpcs.inc	7 Dec 2009 11:36:28 -0000	1.24.2.3
+++ includes/xmlrpcs.inc	29 Dec 2009 21:47:01 -0000
@@ -237,7 +237,7 @@ function xmlrpc_server_multicall($method
       );
     }
     else {
-      $return[] = $result;
+      $return[] = array($result);
     }
   }
   return $return;
