Index: includes/xmlrpc.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/xmlrpc.inc,v
retrieving revision 1.34.2.3
diff -u -p -r1.34.2.3 xmlrpc.inc
--- includes/xmlrpc.inc	13 Jul 2006 18:24:57 -0000	1.34.2.3
+++ includes/xmlrpc.inc	29 Dec 2009 22:05:31 -0000
@@ -66,10 +66,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);
@@ -387,15 +387,16 @@ function xmlrpc_date($time) {
     $xmlrpc_date->hour = date('H', $time);
     $xmlrpc_date->minute = date('i', $time);
     $xmlrpc_date->second = date('s', $time);
-    $xmlrpc_date->iso8601 = date('Ymd\TH:i:s');
+    $xmlrpc_date->iso8601 = date('Ymd\TH:i:s', $time);
   }
   else {
+    $time = str_replace(array('-', ':'), '', $time);
     $xmlrpc_date->year = substr($time, 0, 4);
     $xmlrpc_date->month = substr($time, 4, 2);
     $xmlrpc_date->day = substr($time, 6, 2);
     $xmlrpc_date->hour = substr($time, 9, 2);
-    $xmlrpc_date->minute = substr($time, 12, 2);
-    $xmlrpc_date->second = substr($time, 15, 2);
+    $xmlrpc_date->minute = substr($time, 11, 2);
+    $xmlrpc_date->second = substr($time, 13, 2);
     $xmlrpc_date->iso8601 = $time;
   }
   return $xmlrpc_date;
@@ -417,11 +418,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 functino.
+ * 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();
@@ -438,9 +459,10 @@ 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);
+    xmlrpc_error($result->code, $result->error);
     return FALSE;
   }
   $message = xmlrpc_message($result->data);
@@ -455,8 +477,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.19.2.1
diff -u -p -r1.19.2.1 xmlrpcs.inc
--- includes/xmlrpcs.inc	8 Jun 2006 21:15:35 -0000	1.19.2.1
+++ includes/xmlrpcs.inc	29 Dec 2009 22:05:31 -0000
@@ -239,7 +239,7 @@ function xmlrpc_server_multicall($method
       );
     }
     else {
-      $return[] = $result;
+      $return[] = array($result);
     }
   }
   return $return;
@@ -315,4 +315,4 @@ function xmlrpc_server_method_signature(
 function xmlrpc_server_method_help($method) {
   $xmlrpc_server = xmlrpc_server_get();
   return $xmlrpc_server->help[$method];
-}
\ No newline at end of file
+}
