Skip to content

Commit 33db8c0

Browse files
author
Dmitry Stogov
committed
Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3: Fixed bug #50997 (SOAP Error when trying to submit 2nd Element of a choice).
2 parents 0ab27c3 + 485c09a commit 33db8c0

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
@@ -83,6 +83,10 @@ PHP NEWS
8383
. Fixed bug (segfault due to PS(mod_user_implemented) not be reseted
8484
when close handler call exit). (Laruence)
8585

86+
- SOAP
87+
. Fixed bug #50997 (SOAP Error when trying to submit 2nd Element of a choice).
88+
(Dmitry)
89+
8690
- SPL:
8791
. Fixed bug #62904 (Crash when cloning an object which inherits SplFixedArray)
8892
(Laruence)

ext/soap/php_encoding.c

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

18191819
zend_hash_internal_pointer_reset_ex(model->u.content, &pos);
18201820
while (zend_hash_get_current_data_ex(model->u.content, (void**)&tmp, &pos) == SUCCESS) {
1821-
if (!model_to_xml_object(node, *tmp, object, style, (*tmp)->min_occurs > 0 TSRMLS_CC)) {
1822-
if ((*tmp)->min_occurs > 0) {
1821+
if (!model_to_xml_object(node, *tmp, object, style, strict && ((*tmp)->min_occurs > 0) TSRMLS_CC)) {
1822+
if (!strict || (*tmp)->min_occurs > 0) {
18231823
return 0;
18241824
}
18251825
}
1826+
strict = 1;
18261827
zend_hash_move_forward_ex(model->u.content, &pos);
18271828
}
18281829
return 1;
@@ -1845,7 +1846,7 @@ static int model_to_xml_object(xmlNodePtr node, sdlContentModelPtr model, zval *
18451846
return ret;
18461847
}
18471848
case XSD_CONTENT_GROUP: {
1848-
return model_to_xml_object(node, model->u.group->model, object, style, model->min_occurs > 0 TSRMLS_CC);
1849+
return model_to_xml_object(node, model->u.group->model, object, style, strict && model->min_occurs > 0 TSRMLS_CC);
18491850
}
18501851
default:
18511852
break;

0 commit comments

Comments
 (0)