Skip to content

Commit 485c09a

Browse files
author
Dmitry Stogov
committed
Fixed bug #50997 (SOAP Error when trying to submit 2nd Element of a choice).
1 parent 7e816c0 commit 485c09a

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

NEWS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ PHP NEWS
4444
- Session:
4545
. Fixed bug (segfault due to retval is not initialized). (Laruence)
4646

47+
- SOAP
48+
. Fixed bug #50997 (SOAP Error when trying to submit 2nd Element of a choice).
49+
(Dmitry)
50+
4751
- SPL:
4852
. Bug #62987 (Assigning to ArrayObject[null][something] overrides all
4953
undefined variables). (Laruence)

ext/soap/php_encoding.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1834,11 +1834,12 @@ static int model_to_xml_object(xmlNodePtr node, sdlContentModelPtr model, zval *
18341834

18351835
zend_hash_internal_pointer_reset_ex(model->u.content, &pos);
18361836
while (zend_hash_get_current_data_ex(model->u.content, (void**)&tmp, &pos) == SUCCESS) {
1837-
if (!model_to_xml_object(node, *tmp, object, style, (*tmp)->min_occurs > 0 TSRMLS_CC)) {
1838-
if ((*tmp)->min_occurs > 0) {
1837+
if (!model_to_xml_object(node, *tmp, object, style, strict && ((*tmp)->min_occurs > 0) TSRMLS_CC)) {
1838+
if (!strict || (*tmp)->min_occurs > 0) {
18391839
return 0;
18401840
}
18411841
}
1842+
strict = 1;
18421843
zend_hash_move_forward_ex(model->u.content, &pos);
18431844
}
18441845
return 1;
@@ -1861,7 +1862,7 @@ static int model_to_xml_object(xmlNodePtr node, sdlContentModelPtr model, zval *
18611862
return ret;
18621863
}
18631864
case XSD_CONTENT_GROUP: {
1864-
return model_to_xml_object(node, model->u.group->model, object, style, model->min_occurs > 0 TSRMLS_CC);
1865+
return model_to_xml_object(node, model->u.group->model, object, style, strict && model->min_occurs > 0 TSRMLS_CC);
18651866
}
18661867
default:
18671868
break;

0 commit comments

Comments
 (0)