From 0e8a3c13440d3dada4a8a6dac367c434cd073302 Mon Sep 17 00:00:00 2001 From: Gerhard Killesreiter Date: Mon, 24 Apr 2006 10:49:38 +0000 Subject: [PATCH] #59513, XML-RPC struct spawns empty parameters, patch by chx --- includes/xmlrpc.inc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/includes/xmlrpc.inc b/includes/xmlrpc.inc index f87b16ff93c..fcf7d8624d4 100644 --- a/includes/xmlrpc.inc +++ b/includes/xmlrpc.inc @@ -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);