diff --git a/NEWS b/NEWS index e39b10d1a65..92795c90345 100644 --- a/NEWS +++ b/NEWS @@ -24,6 +24,7 @@ PHP NEWS - Soap: . Fixed bug GH-8578 (Error on wrong parameter on SoapHeader constructor). (robertnisipeanu) + . Fixed bug GH-8538 (SoapClient may strip parts of nmtokens). (cmb) - SPL: . Fixed bug GH-8235 (iterator_count() may run indefinitely). (cmb) diff --git a/ext/soap/php_sdl.c b/ext/soap/php_sdl.c index a271ca8fcd2..e5e7f2f9554 100644 --- a/ext/soap/php_sdl.c +++ b/ext/soap/php_sdl.c @@ -883,7 +883,7 @@ static sdlPtr load_wsdl(zval *this_ptr, char *struri) soap_error0(E_ERROR, "Parsing WSDL: Missing 'type' attribute for "); } - ctype = strrchr((char*)type->children->content,':'); + ctype = strchr((char*)type->children->content,':'); if (ctype == NULL) { ctype = (char*)type->children->content; } else { diff --git a/ext/soap/tests/gh8538.phpt b/ext/soap/tests/gh8538.phpt new file mode 100644 index 00000000000..18386f5d4b7 --- /dev/null +++ b/ext/soap/tests/gh8538.phpt @@ -0,0 +1,30 @@ +--TEST-- +Bug GH-8538 (SoapClient may strip parts of nmtokens) +--SKIPIF-- + +--FILE-- +__getFunctions()); +?> +--EXPECT-- +array(9) { + [0]=> + string(71) "reportHealthViewResponse reportHealthView(reportHealthView $parameters)" + [1]=> + string(59) "reportPolicyResponse reportPolicy(reportPolicy $parameters)" + [2]=> + string(56) "queryPolicyResponse queryPolicy(queryPolicy $parameters)" + [3]=> + string(59) "reportConfigResponse reportConfig(reportConfig $parameters)" + [4]=> + string(56) "reportEventResponse reportEvent(reportEvent $parameters)" + [5]=> + string(53) "reportViewResponse reportView(reportView $parameters)" + [6]=> + string(56) "queryConfigResponse queryConfig(queryConfig $parameters)" + [7]=> + string(50) "queryViewResponse queryView(queryView $parameters)" + [8]=> + string(50) "reportLogResponse reportLog(reportLog $parameters)" +} diff --git a/ext/soap/tests/gh8538.wsdl b/ext/soap/tests/gh8538.wsdl new file mode 100644 index 00000000000..cbcb4b9aa13 --- /dev/null +++ b/ext/soap/tests/gh8538.wsdl @@ -0,0 +1,314 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file