- Patch #208270 by jvandyk: fixed error handling of XML-RPC library.
parent
9db1abf5aa
commit
92eda80f3a
|
@ -342,7 +342,7 @@ EOD;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function xmlrpc_error($code = NULL, $message = NULL) {
|
function xmlrpc_error($code = NULL, $message = NULL, $reset = FALSE) {
|
||||||
static $xmlrpc_error;
|
static $xmlrpc_error;
|
||||||
if (isset($code)) {
|
if (isset($code)) {
|
||||||
$xmlrpc_error = new stdClass();
|
$xmlrpc_error = new stdClass();
|
||||||
|
@ -351,6 +351,9 @@ function xmlrpc_error($code = NULL, $message = NULL) {
|
||||||
$xmlrpc_error->message = $message;
|
$xmlrpc_error->message = $message;
|
||||||
module_invoke('system', 'check_http_request');
|
module_invoke('system', 'check_http_request');
|
||||||
}
|
}
|
||||||
|
elseif ($reset) {
|
||||||
|
$xmlrpc_error = NULL;
|
||||||
|
}
|
||||||
return $xmlrpc_error;
|
return $xmlrpc_error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -427,6 +430,7 @@ function xmlrpc_base64_get_xml($xmlrpc_base64) {
|
||||||
function _xmlrpc() {
|
function _xmlrpc() {
|
||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
$url = array_shift($args);
|
$url = array_shift($args);
|
||||||
|
xmlrpc_clear_error();
|
||||||
if (is_array($args[0])) {
|
if (is_array($args[0])) {
|
||||||
$method = 'system.multicall';
|
$method = 'system.multicall';
|
||||||
$multicall_args = array();
|
$multicall_args = array();
|
||||||
|
@ -475,3 +479,10 @@ function xmlrpc_error_msg() {
|
||||||
$error = xmlrpc_error();
|
$error = xmlrpc_error();
|
||||||
return ($error != NULL ? $error->message : NULL);
|
return ($error != NULL ? $error->message : NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Clears any previous error.
|
||||||
|
*/
|
||||||
|
function xmlrpc_clear_error() {
|
||||||
|
xmlrpc_error(NULL, NULL, TRUE);
|
||||||
|
}
|
Loading…
Reference in New Issue