diff options
author | Gerhard Killesreiter <killes_www_drop_org@227.no-reply.drupal.org> | 2006-04-24 10:49:38 +0000 |
---|---|---|
committer | Gerhard Killesreiter <killes_www_drop_org@227.no-reply.drupal.org> | 2006-04-24 10:49:38 +0000 |
commit | 0e8a3c13440d3dada4a8a6dac367c434cd073302 (patch) | |
tree | b403489ee4b0961415ac509f0682849ebb723de2 /includes/xmlrpc.inc | |
parent | 85a855811716310b6be32ac444205270fca3ae26 (diff) | |
download | brdo-0e8a3c13440d3dada4a8a6dac367c434cd073302.tar.gz brdo-0e8a3c13440d3dada4a8a6dac367c434cd073302.tar.bz2 |
#59513, XML-RPC struct spawns empty parameters, patch by chx
Diffstat (limited to 'includes/xmlrpc.inc')
-rw-r--r-- | includes/xmlrpc.inc | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/includes/xmlrpc.inc b/includes/xmlrpc.inc index f87b16ff9..fcf7d8624 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); |