summaryrefslogtreecommitdiff
path: root/includes/xmlrpc.inc
diff options
context:
space:
mode:
authorGerhard Killesreiter <killes_www_drop_org@227.no-reply.drupal.org>2006-04-24 10:49:38 +0000
committerGerhard Killesreiter <killes_www_drop_org@227.no-reply.drupal.org>2006-04-24 10:49:38 +0000
commit0e8a3c13440d3dada4a8a6dac367c434cd073302 (patch)
treeb403489ee4b0961415ac509f0682849ebb723de2 /includes/xmlrpc.inc
parent85a855811716310b6be32ac444205270fca3ae26 (diff)
downloadbrdo-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.inc10
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);