]> granicus.if.org Git - php/commitdiff
- Fixed bug #41097 (ext/soap returning associative array as indexed without
authorDmitry Stogov <dmitry@php.net>
Fri, 4 May 2007 06:19:34 +0000 (06:19 +0000)
committerDmitry Stogov <dmitry@php.net>
Fri, 4 May 2007 06:19:34 +0000 (06:19 +0000)
  using WSDL).
- Fixed bug #41004 (minOccurs="0" and null class member variable).

NEWS
ext/soap/php_encoding.c

diff --git a/NEWS b/NEWS
index 03c1bb5d0d9f3f8004ad08ccb9142ab1570d4e0d..86fe272817a493523849f768727e49d532eb7340 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -4,6 +4,9 @@ PHP                                                                        NEWS
 - Fixed ext/filter Email Validation Vulnerability (MOPB-24 by Stefan Esser)
   (Ilia)
 - Fixed altering $this via argument named "this". (Dmitry)
+- Fixed bug #41097 (ext/soap returning associative array as indexed without
+  using WSDL). (Dmitry)
+- Fixed bug #41004 (minOccurs="0" and null class member variable). (Dmitry)
 
 03 May 2007, PHP 5.2.2
 - Improved bundled GD
index 2ae06a768a1b8627e1075801b5ca76a7343034cc..6a2c71d5837de541f60ca57aafdcd787876925c2 100644 (file)
@@ -1595,6 +1595,8 @@ static int model_to_xml_object(xmlNodePtr node, sdlContentModelPtr model, zval *
                                                property = xmlNewNode(NULL, BAD_CAST("BOGUS"));
                                                xmlAddChild(node, property);
                                                set_xsi_nil(property);
+                                       } else if (Z_TYPE_P(data) == IS_NULL && model->min_occurs == 0) {
+                                               return 1;
                                        } else {
                                                property = master_to_xml(enc, data, style, node);
                                                if (property->children && property->children->content &&
@@ -3356,8 +3358,12 @@ static int is_map(zval *array)
        int i, count = zend_hash_num_elements(Z_ARRVAL_P(array));
 
        zend_hash_internal_pointer_reset(Z_ARRVAL_P(array));
-       for (i = 0;i < count;i++) {
-               if (zend_hash_get_current_key_type(Z_ARRVAL_P(array)) == HASH_KEY_IS_STRING) {
+       for (i = 0; i < count; i++) {
+               char *str_index;
+               ulong num_index;
+
+               if (zend_hash_get_current_key(Z_ARRVAL_P(array), &str_index, &num_index, 0) == HASH_KEY_IS_STRING ||
+                   num_index != i) {
                        return TRUE;
                }
                zend_hash_move_forward(Z_ARRVAL_P(array));