From 72660567f40d6331cf13de90b816068f2c68826c Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Mon, 14 Nov 2011 08:43:00 +0000 Subject: [PATCH] Fixed bug #44686 (SOAP-ERROR: Parsing WSDL with references) --- ext/soap/php_schema.c | 10 +- ext/soap/tests/bugs/bug44686.phpt | 14 +++ ext/soap/tests/bugs/bug44686.wsdl | 193 ++++++++++++++++++++++++++++++ 3 files changed, 212 insertions(+), 5 deletions(-) create mode 100644 ext/soap/tests/bugs/bug44686.phpt create mode 100644 ext/soap/tests/bugs/bug44686.wsdl diff --git a/ext/soap/php_schema.c b/ext/soap/php_schema.c index f0fe981b15..159a759921 100644 --- a/ext/soap/php_schema.c +++ b/ext/soap/php_schema.c @@ -1081,8 +1081,8 @@ static int schema_group(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr groupType, sdlTyp nsptr = xmlSearchNs(groupType->doc, groupType, BAD_CAST(ns)); if (nsptr != NULL) { smart_str_appends(&key, (char*)nsptr->href); - smart_str_appendc(&key, ':'); } + smart_str_appendc(&key, ':'); smart_str_appends(&key, type); smart_str_0(&key); @@ -1508,9 +1508,9 @@ static int schema_element(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr element, sdlTyp nsptr = xmlSearchNs(element->doc, element, BAD_CAST(ns)); if (nsptr != NULL) { smart_str_appends(&nscat, (char*)nsptr->href); - smart_str_appendc(&nscat, ':'); newType->namens = estrdup((char*)nsptr->href); - } + } + smart_str_appendc(&nscat, ':'); smart_str_appends(&nscat, type); newType->name = estrdup(type); smart_str_0(&nscat); @@ -1734,9 +1734,9 @@ static int schema_attribute(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr attrType, sdl nsptr = xmlSearchNs(attrType->doc, attrType, BAD_CAST(ns)); if (nsptr != NULL) { smart_str_appends(&key, (char*)nsptr->href); - smart_str_appendc(&key, ':'); newAttr->namens = estrdup((char*)nsptr->href); } + smart_str_appendc(&key, ':'); smart_str_appends(&key, attr_name); smart_str_0(&key); newAttr->ref = estrdup(key.c); @@ -1970,8 +1970,8 @@ static int schema_attributeGroup(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr attrGrou nsptr = xmlSearchNs(attrGroup->doc, attrGroup, BAD_CAST(ns)); if (nsptr != NULL) { smart_str_appends(&key, (char*)nsptr->href); - smart_str_appendc(&key, ':'); } + smart_str_appendc(&key, ':'); smart_str_appends(&key, group_name); smart_str_0(&key); newAttr->ref = estrdup(key.c); diff --git a/ext/soap/tests/bugs/bug44686.phpt b/ext/soap/tests/bugs/bug44686.phpt new file mode 100644 index 0000000000..cff97999c6 --- /dev/null +++ b/ext/soap/tests/bugs/bug44686.phpt @@ -0,0 +1,14 @@ +--TEST-- +Bug #44686 (SOAP-ERROR: Parsing WSDL with references) +--SKIPIF-- + +--INI-- +soap.wsdl_cache_enabled=0 +--FILE-- + +--EXPECT-- +ok + diff --git a/ext/soap/tests/bugs/bug44686.wsdl b/ext/soap/tests/bugs/bug44686.wsdl new file mode 100644 index 0000000000..87b4640b78 --- /dev/null +++ b/ext/soap/tests/bugs/bug44686.wsdl @@ -0,0 +1,193 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- 2.40.0