#59513, XML-RPC struct spawns empty parameters, patch by chx

4.7.x
Gerhard Killesreiter 2006-04-24 10:49:38 +00:00
parent 85a8558117
commit 0e8a3c1344
1 changed files with 8 additions and 2 deletions

View File

@ -165,6 +165,7 @@ function xmlrpc_message_get() {
function xmlrpc_message_tag_open($parser, $tag, $attr) {
$xmlrpc_message = xmlrpc_message_get();
$xmlrpc_message->current_tag_contents = '';
$xmlrpc_message->last_open = $tag;
switch($tag) {
case 'methodCall':
case 'methodResponse':
@ -213,8 +214,13 @@ function xmlrpc_message_tag_close($parser, $tag) {
$value_flag = TRUE;
break;
case 'value':
$value = (string)$xmlrpc_message->current_tag_contents;
$value_flag = TRUE;
// If no type is indicated, the type is string.
// We take special care for empty values
if (trim($xmlrpc_message->current_tag_contents) != '' || $xmlrpc_message->last_open == 'value') {
$value = (string)$xmlrpc_message->current_tag_contents;
$value_flag = TRUE;
}
unset($xmlrpc_message->last_open);
break;
case 'boolean':
$value = (boolean)trim($xmlrpc_message->current_tag_contents);