Skip to content
Snippets Groups Projects
Commit 0e8a3c13 authored by Gerhard Killesreiter's avatar Gerhard Killesreiter
Browse files

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

parent 85a85581
Branches
Tags
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment