diff includes/xmlrpc.inc @ 11:589fb7c02327 6.5

Drupal 6.5
author Franck Deroche <webmaster@defr.org>
date Tue, 23 Dec 2008 14:32:19 +0100
parents fff6d4c8c043
children 8b6c45761e01
line wrap: on
line diff
--- a/includes/xmlrpc.inc	Tue Dec 23 14:32:08 2008 +0100
+++ b/includes/xmlrpc.inc	Tue Dec 23 14:32:19 2008 +0100
@@ -1,5 +1,5 @@
 <?php
-// $Id: xmlrpc.inc,v 1.47.2.2 2008/04/14 18:01:19 dries Exp $
+// $Id: xmlrpc.inc,v 1.47.2.3 2008/09/17 06:28:54 goba Exp $
 
 /**
  * @file
@@ -342,7 +342,7 @@
 }
 
 
-function xmlrpc_error($code = NULL, $message = NULL) {
+function xmlrpc_error($code = NULL, $message = NULL, $reset = FALSE) {
   static $xmlrpc_error;
   if (isset($code)) {
     $xmlrpc_error = new stdClass();
@@ -351,6 +351,9 @@
     $xmlrpc_error->message = $message;
     module_invoke('system', 'check_http_request');
   }
+  elseif ($reset) {
+    $xmlrpc_error = NULL;
+  }
   return $xmlrpc_error;
 }
 
@@ -427,6 +430,7 @@
 function _xmlrpc() {
   $args = func_get_args();
   $url = array_shift($args);
+  xmlrpc_clear_error();
   if (is_array($args[0])) {
     $method = 'system.multicall';
     $multicall_args = array();
@@ -475,3 +479,10 @@
   $error = xmlrpc_error();
   return ($error != NULL ? $error->message : NULL);
 }
+
+/**
+ * Clears any previous error.
+ */
+function xmlrpc_clear_error() {
+  xmlrpc_error(NULL, NULL, TRUE);
+}