diff options
author | Dmitry Stogov <dmitry@tpl2.home> | 2012-09-03 11:49:58 +0400 |
---|---|---|
committer | Dmitry Stogov <dmitry@tpl2.home> | 2012-09-03 11:49:58 +0400 |
commit | 485c09a3765b900aea182ddd2dded2286fb0749a (patch) | |
tree | f39f0b291f848b757a37f5232f0b377d19fb4a94 | |
parent | 7e816c0921b4fee488d47b8a060ef820a7c46e38 (diff) | |
download | php-git-485c09a3765b900aea182ddd2dded2286fb0749a.tar.gz |
Fixed bug #50997 (SOAP Error when trying to submit 2nd Element of a choice).
-rw-r--r-- | NEWS | 4 | ||||
-rw-r--r-- | ext/soap/php_encoding.c | 7 |
2 files changed, 8 insertions, 3 deletions
@@ -44,6 +44,10 @@ PHP NEWS - Session: . Fixed bug (segfault due to retval is not initialized). (Laruence) +- SOAP + . Fixed bug #50997 (SOAP Error when trying to submit 2nd Element of a choice). + (Dmitry) + - SPL: . Bug #62987 (Assigning to ArrayObject[null][something] overrides all undefined variables). (Laruence) diff --git a/ext/soap/php_encoding.c b/ext/soap/php_encoding.c index 97a79a349e..ee28d99dc0 100644 --- a/ext/soap/php_encoding.c +++ b/ext/soap/php_encoding.c @@ -1834,11 +1834,12 @@ static int model_to_xml_object(xmlNodePtr node, sdlContentModelPtr model, zval * zend_hash_internal_pointer_reset_ex(model->u.content, &pos); while (zend_hash_get_current_data_ex(model->u.content, (void**)&tmp, &pos) == SUCCESS) { - if (!model_to_xml_object(node, *tmp, object, style, (*tmp)->min_occurs > 0 TSRMLS_CC)) { - if ((*tmp)->min_occurs > 0) { + if (!model_to_xml_object(node, *tmp, object, style, strict && ((*tmp)->min_occurs > 0) TSRMLS_CC)) { + if (!strict || (*tmp)->min_occurs > 0) { return 0; } } + strict = 1; zend_hash_move_forward_ex(model->u.content, &pos); } return 1; @@ -1861,7 +1862,7 @@ static int model_to_xml_object(xmlNodePtr node, sdlContentModelPtr model, zval * return ret; } case XSD_CONTENT_GROUP: { - return model_to_xml_object(node, model->u.group->model, object, style, model->min_occurs > 0 TSRMLS_CC); + return model_to_xml_object(node, model->u.group->model, object, style, strict && model->min_occurs > 0 TSRMLS_CC); } default: break; |