From f946918fc69ba2a74309ebbc37d7c18432a96902 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Mon, 26 Jan 2009 11:09:36 +0000 Subject: Fixed bug #46419 (Elements of associative arrays with NULL value are lost) --- ext/soap/php_encoding.c | 44 +++++++++++++++++++++----------------------- 1 file changed, 21 insertions(+), 23 deletions(-) (limited to 'ext/soap/php_encoding.c') diff --git a/ext/soap/php_encoding.c b/ext/soap/php_encoding.c index 33f03d46be..a33b794f25 100644 --- a/ext/soap/php_encoding.c +++ b/ext/soap/php_encoding.c @@ -2775,33 +2775,31 @@ static xmlNodePtr to_xml_map(encodeTypePtr type, zval *data, int style, xmlNodeP ulong int_val; zend_hash_get_current_data(data->value.ht, (void **)&temp_data); - if (Z_TYPE_PP(temp_data) != IS_NULL) { - item = xmlNewNode(NULL, BAD_CAST("item")); - xmlAddChild(xmlParam, item); - key = xmlNewNode(NULL, BAD_CAST("key")); - xmlAddChild(item,key); - if (zend_hash_get_current_key(data->value.ht, &key_val, &int_val, FALSE) == HASH_KEY_IS_STRING) { - if (style == SOAP_ENCODED) { - set_xsi_type(key, "xsd:string"); - } - xmlNodeSetContent(key, BAD_CAST(key_val)); - } else { - smart_str tmp = {0}; - smart_str_append_long(&tmp, int_val); - smart_str_0(&tmp); - - if (style == SOAP_ENCODED) { - set_xsi_type(key, "xsd:int"); - } - xmlNodeSetContentLen(key, BAD_CAST(tmp.c), tmp.len); - - smart_str_free(&tmp); + item = xmlNewNode(NULL, BAD_CAST("item")); + xmlAddChild(xmlParam, item); + key = xmlNewNode(NULL, BAD_CAST("key")); + xmlAddChild(item,key); + if (zend_hash_get_current_key(data->value.ht, &key_val, &int_val, FALSE) == HASH_KEY_IS_STRING) { + if (style == SOAP_ENCODED) { + set_xsi_type(key, "xsd:string"); } + xmlNodeSetContent(key, BAD_CAST(key_val)); + } else { + smart_str tmp = {0}; + smart_str_append_long(&tmp, int_val); + smart_str_0(&tmp); - xparam = master_to_xml(get_conversion((*temp_data)->type), (*temp_data), style, item); + if (style == SOAP_ENCODED) { + set_xsi_type(key, "xsd:int"); + } + xmlNodeSetContentLen(key, BAD_CAST(tmp.c), tmp.len); - xmlNodeSetName(xparam, BAD_CAST("value")); + smart_str_free(&tmp); } + + xparam = master_to_xml(get_conversion((*temp_data)->type), (*temp_data), style, item); + xmlNodeSetName(xparam, BAD_CAST("value")); + zend_hash_move_forward(data->value.ht); } } -- cgit v1.2.1