diff options
author | Dries Buytaert <dries@buytaert.net> | 2008-08-08 20:00:09 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2008-08-08 20:00:09 +0000 |
commit | 92eda80f3a516a9c9215acc26db7d51ff52caf5d (patch) | |
tree | 08a16789e9efced22409cd6242d4d2d087c843e2 /includes/xmlrpc.inc | |
parent | 9db1abf5aa19d620adcb843e074bc165812efb70 (diff) | |
download | brdo-92eda80f3a516a9c9215acc26db7d51ff52caf5d.tar.gz brdo-92eda80f3a516a9c9215acc26db7d51ff52caf5d.tar.bz2 |
- Patch #208270 by jvandyk: fixed error handling of XML-RPC library.
Diffstat (limited to 'includes/xmlrpc.inc')
-rw-r--r-- | includes/xmlrpc.inc | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/includes/xmlrpc.inc b/includes/xmlrpc.inc index 4895e9802..28b160b24 100644 --- a/includes/xmlrpc.inc +++ b/includes/xmlrpc.inc @@ -342,7 +342,7 @@ EOD; } -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 @@ function xmlrpc_error($code = NULL, $message = NULL) { $xmlrpc_error->message = $message; module_invoke('system', 'check_http_request'); } + elseif ($reset) { + $xmlrpc_error = NULL; + } return $xmlrpc_error; } @@ -427,6 +430,7 @@ function xmlrpc_base64_get_xml($xmlrpc_base64) { 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 @@ function xmlrpc_error_msg() { $error = xmlrpc_error(); return ($error != NULL ? $error->message : NULL); } + +/** + * Clears any previous error. + */ +function xmlrpc_clear_error() { + xmlrpc_error(NULL, NULL, TRUE); +}
\ No newline at end of file |