]> granicus.if.org Git - php/commitdiff
Merge branch 'PHP-5.6'
authorXinchen Hui <laruence@php.net>
Tue, 11 Nov 2014 08:31:32 +0000 (16:31 +0800)
committerXinchen Hui <laruence@php.net>
Tue, 11 Nov 2014 08:31:32 +0000 (16:31 +0800)
Conflicts:
ext/soap/soap.c

1  2 
ext/soap/soap.c

diff --cc ext/soap/soap.c
index 2b37622a7aa73351fde704c13fe67897df480a54,31ea77598942eb166c2b97fd40356f08660ab416..94b5cf22a2e4c0c6eb69dc3352427adc0e9cad91
@@@ -4705,19 -4738,21 +4705,20 @@@ static void type_to_string(sdlTypePtr t
                        if (type->encode &&
                            (type->encode->details.type == IS_ARRAY ||
                             type->encode->details.type == SOAP_ENC_ARRAY)) {
 -                        sdlAttributePtr *attr;
 -                        sdlExtraAttributePtr *ext;
 +                        sdlAttributePtr attr;
 +                        sdlExtraAttributePtr ext;
  
                                if (type->attributes &&
 -                                  zend_hash_find(type->attributes, SOAP_1_1_ENC_NAMESPACE":arrayType",
 -                                    sizeof(SOAP_1_1_ENC_NAMESPACE":arrayType"),
 -                                    (void **)&attr) == SUCCESS &&
 -                                    (*attr)->extraAttributes &&
 -                                    zend_hash_find((*attr)->extraAttributes, WSDL_NAMESPACE":arrayType", sizeof(WSDL_NAMESPACE":arrayType"), (void **)&ext) == SUCCESS) {
 -                                      char *end = strchr((*ext)->val, '[');
 +                                  (attr = zend_hash_str_find_ptr(type->attributes, SOAP_1_1_ENC_NAMESPACE":arrayType",
 +                                    sizeof(SOAP_1_1_ENC_NAMESPACE":arrayType")-1)) != NULL &&
++                                      attr->extraAttributes &&
 +                                  (ext = zend_hash_str_find_ptr(attr->extraAttributes, WSDL_NAMESPACE":arrayType", sizeof(WSDL_NAMESPACE":arrayType")-1)) != NULL) {
 +                                      char *end = strchr(ext->val, '[');
                                        int len;
                                        if (end == NULL) {
 -                                              len = strlen((*ext)->val);
 +                                              len = strlen(ext->val);
                                        } else {
 -                                              len = end-(*ext)->val;
 +                                              len = end-ext->val;
                                        }
                                        if (len == 0) {
                                                smart_str_appendl(buf, "anyType", sizeof("anyType")-1);
                                } else {
                                        sdlTypePtr elementType;
                                        if (type->attributes &&
 -                                          zend_hash_find(type->attributes, SOAP_1_2_ENC_NAMESPACE":itemType",
 -                                            sizeof(SOAP_1_2_ENC_NAMESPACE":itemType"),
 -                                            (void **)&attr) == SUCCESS &&
 -                                            (*attr)->extraAttributes &&
 -                                            zend_hash_find((*attr)->extraAttributes, WSDL_NAMESPACE":itemType", sizeof(WSDL_NAMESPACE":arrayType"), (void **)&ext) == SUCCESS) {
 -                                              smart_str_appends(buf, (*ext)->val);
 +                                          (attr = zend_hash_str_find_ptr(type->attributes, SOAP_1_2_ENC_NAMESPACE":itemType",
 +                                            sizeof(SOAP_1_2_ENC_NAMESPACE":itemType")-1)) != NULL &&
++                                              attr->extraAttributes &&
 +                                  (ext = zend_hash_str_find_ptr(attr->extraAttributes, WSDL_NAMESPACE":itemType", sizeof(WSDL_NAMESPACE":arrayType")-1)) != NULL) {
 +                                              smart_str_appends(buf, ext->val);
                                                smart_str_appendc(buf, ' ');
                                        } else if (type->elements &&
                                                   zend_hash_num_elements(type->elements) == 1 &&
                                        }
                                        smart_str_appendl(buf, type->name, strlen(type->name));
                                        if (type->attributes &&
 -                                          zend_hash_find(type->attributes, SOAP_1_2_ENC_NAMESPACE":arraySize",
 -                                            sizeof(SOAP_1_2_ENC_NAMESPACE":arraySize"),
 -                                            (void **)&attr) == SUCCESS &&
 -                                            (*attr)->extraAttributes &&
 -                                            zend_hash_find((*attr)->extraAttributes, WSDL_NAMESPACE":itemType", sizeof(WSDL_NAMESPACE":arraySize"), (void **)&ext) == SUCCESS) {
 +                                          (attr = zend_hash_str_find_ptr(type->attributes, SOAP_1_2_ENC_NAMESPACE":arraySize",
 +                                            sizeof(SOAP_1_2_ENC_NAMESPACE":arraySize")-1)) != NULL &&
++                                              attr->extraAttributes &&
 +                                          (ext = zend_hash_str_find_ptr(attr->extraAttributes, WSDL_NAMESPACE":itemType", sizeof(WSDL_NAMESPACE":arraySize")-1)) != NULL) {
                                                smart_str_appendc(buf, '[');
 -                                              smart_str_appends(buf, (*ext)->val);
 +                                              smart_str_appends(buf, ext->val);
                                                smart_str_appendc(buf, ']');
                                        } else {
                                                smart_str_appendl(buf, "[]", 2);