From f0778af38440740d1f5b2db5ce1133bab8f40cda Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Thu, 10 May 2007 14:58:32 +0000 Subject: [PATCH] Fixed bug #41337 (WSDL parsing doesn't ignore non soap bindings) --- ext/soap/php_sdl.c | 10 ++++- ext/soap/tests/bugs/bug41337.phpt | 12 ++++++ ext/soap/tests/bugs/bug41337.wsdl | 63 +++++++++++++++++++++++++++++++ 3 files changed, 84 insertions(+), 1 deletion(-) create mode 100755 ext/soap/tests/bugs/bug41337.phpt create mode 100755 ext/soap/tests/bugs/bug41337.wsdl diff --git a/ext/soap/php_sdl.c b/ext/soap/php_sdl.c index 62fbf1f105..6d076344da 100644 --- a/ext/soap/php_sdl.c +++ b/ext/soap/php_sdl.c @@ -654,6 +654,7 @@ static sdlPtr load_wsdl(char *struri TSRMLS_DC) for (i = 0; i < n; i++) { xmlNodePtr *tmp, service; xmlNodePtr trav, port; + int has_soap_port = 0; zend_hash_get_current_data(&ctx.services, (void **)&tmp); service = *tmp; @@ -716,8 +717,15 @@ static sdlPtr load_wsdl(char *struri TSRMLS_DC) trav2 = trav2->next; } if (!address) { - soap_error0(E_ERROR, "Parsing WSDL: No address associated with "); + if (has_soap_port || trav->next) { + efree(tmpbinding); + trav = trav->next; + continue; + } else { + soap_error0(E_ERROR, "Parsing WSDL: No address associated with "); + } } + has_soap_port = 1; location = get_attribute(address->properties, "location"); if (!location) { diff --git a/ext/soap/tests/bugs/bug41337.phpt b/ext/soap/tests/bugs/bug41337.phpt new file mode 100755 index 0000000000..cd777d1dea --- /dev/null +++ b/ext/soap/tests/bugs/bug41337.phpt @@ -0,0 +1,12 @@ +--TEST-- +Bug #41337 (WSDL parsing doesn't ignore non soap bindings) +--SKIPIF-- + +--FILE-- + +--EXPECT-- +ok diff --git a/ext/soap/tests/bugs/bug41337.wsdl b/ext/soap/tests/bugs/bug41337.wsdl new file mode 100755 index 0000000000..14e5dc4b4e --- /dev/null +++ b/ext/soap/tests/bugs/bug41337.wsdl @@ -0,0 +1,63 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- 2.50.1