diff options
author | kusano <kusano@users.noreply.github.com> | 2016-02-17 01:00:58 +0900 |
---|---|---|
committer | kusano <kusano@users.noreply.github.com> | 2016-02-17 01:00:58 +0900 |
commit | 07cae46b02795f8364d28ecad6ec45f507e7114b (patch) | |
tree | 47795fa54a8cf014e918d8bfe3056e9b30ec9b0e /ext/soap/php_encoding.c | |
parent | d31e8a9a85efea54db0b647424f6c4485d71db8b (diff) | |
parent | 3244d3c7e936b23ad33892e367500f64468c6140 (diff) | |
download | php-git-07cae46b02795f8364d28ecad6ec45f507e7114b.tar.gz |
Merge branch 'master' into fix-mt_rand
Conflicts:
ext/standard/rand.c
Diffstat (limited to 'ext/soap/php_encoding.c')
-rw-r--r-- | ext/soap/php_encoding.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/ext/soap/php_encoding.c b/ext/soap/php_encoding.c index c03d433951..1fdc5a8788 100644 --- a/ext/soap/php_encoding.c +++ b/ext/soap/php_encoding.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2015 The PHP Group | + | Copyright (c) 1997-2016 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -2188,9 +2188,8 @@ static void add_xml_array_elements(xmlNodePtr xmlParam, static inline int array_num_elements(HashTable* ht) { if (ht->nNumUsed && - Z_TYPE(ht->arData[ht->nNumUsed-1].val) != IS_UNUSED && + Z_TYPE(ht->arData[ht->nNumUsed-1].val) != IS_UNDEF && ht->arData[ht->nNumUsed-1].key == NULL) { - return ht->arData[ht->nNumUsed-1].h - 1; } return 0; @@ -3015,7 +3014,11 @@ static xmlNodePtr to_xml_list(encodeTypePtr enc, zval *data, int style, xmlNodeP xmlFreeNode(dummy); } ZEND_HASH_FOREACH_END(); smart_str_0(&list); - xmlNodeSetContentLen(ret, BAD_CAST(ZSTR_VAL(list.s)), ZSTR_LEN(list.s)); + if (list.s) { + xmlNodeSetContentLen(ret, BAD_CAST(ZSTR_VAL(list.s)), ZSTR_LEN(list.s)); + } else { + xmlNodeSetContentLen(ret, BAD_CAST(""), 0); + } smart_str_free(&list); } else { zval tmp; @@ -3055,7 +3058,11 @@ static xmlNodePtr to_xml_list(encodeTypePtr enc, zval *data, int style, xmlNodeP start = next; } smart_str_0(&list); - xmlNodeSetContentLen(ret, BAD_CAST(ZSTR_VAL(list.s)), ZSTR_LEN(list.s)); + if (list.s) { + xmlNodeSetContentLen(ret, BAD_CAST(ZSTR_VAL(list.s)), ZSTR_LEN(list.s)); + } else { + xmlNodeSetContentLen(ret, BAD_CAST(""), 0); + } smart_str_free(&list); efree(str); if (data == &tmp) {zval_dtor(&tmp);} |