Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
37bacdac
Commit
37bacdac
authored
Dec 29, 2009
by
Dries
Browse files
- Patch
#646678
by fgm: fixed incorrect multicall implementation.
parent
43089856
Changes
2
Show whitespace changes
Inline
Side-by-side
includes/xmlrpc.inc
View file @
37bacdac
...
...
@@ -433,13 +433,15 @@ function xmlrpc_base64_get_xml($xmlrpc_base64) {
* 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
* For one request:
* Either the return value of the method on success, or FALSE.
* If FALSE is returned, see xmlrpc_errno() and xmlrpc_error_msg().
* For multiple requests:
* An array of results. Each result will either be the result
* returned by the method called, or an xmlrpc_error object if the call
* failed. See xmlrpc_error().
* 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
();
...
...
@@ -479,8 +481,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
;
}
/**
...
...
includes/xmlrpcs.inc
View file @
37bacdac
...
...
@@ -235,7 +235,7 @@ function xmlrpc_server_multicall($methodcalls) {
);
}
else
{
$return
[]
=
$result
;
$return
[]
=
array
(
$result
)
;
}
}
return
$return
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment