diff options
| author | krakjoe <joe.watkins@live.co.uk> | 2014-11-25 08:37:02 +0000 |
|---|---|---|
| committer | krakjoe <joe.watkins@live.co.uk> | 2014-11-25 08:37:02 +0000 |
| commit | e07feeaf8b91f16a89e9903b461042a0f6a63ac0 (patch) | |
| tree | 4a94cd382fcffefff920f7733562e1860a66cc44 /ext/soap | |
| parent | 9b6836ebd36eccc9e81ca51e2efe172e1d334f0b (diff) | |
| parent | d4f42289ddde002cb4d3ed9d1a4f2219f68df48e (diff) | |
| download | php-git-e07feeaf8b91f16a89e9903b461042a0f6a63ac0.tar.gz | |
Merge branch 'master' of https://github.com/php/php-src
Diffstat (limited to 'ext/soap')
| -rw-r--r-- | ext/soap/TODO.old | 2 | ||||
| -rw-r--r-- | ext/soap/interop/client_round2_interop.php | 18 | ||||
| -rw-r--r-- | ext/soap/package.xml | 2 | ||||
| -rw-r--r-- | ext/soap/php_sdl.h | 2 | ||||
| -rw-r--r-- | ext/soap/php_soap.h | 2 | ||||
| -rw-r--r-- | ext/soap/soap.c | 19 | ||||
| -rw-r--r-- | ext/soap/tests/bug68361.phpt | 114 | ||||
| -rw-r--r-- | ext/soap/tests/bugs/bug27742.wsdl | 4 | ||||
| -rw-r--r-- | ext/soap/tests/bugs/bug50698_2.phpt | 2 |
9 files changed, 141 insertions, 24 deletions
diff --git a/ext/soap/TODO.old b/ext/soap/TODO.old index b219c61f8a..821dc31072 100644 --- a/ext/soap/TODO.old +++ b/ext/soap/TODO.old @@ -18,7 +18,7 @@ when using wsdls and function names are similar find the best match void test(int); void test(string); maybe use the same alogrithim as ext/java. -investigate further http keep_alive... inital testing proved slower.. maybe php_streams will speed things up.. +investigate further http keep_alive... initial testing proved slower.. maybe php_streams will speed things up.. provide schema 1999/2001 support.... through memory leak testing possible using shared memory for sdl caching... diff --git a/ext/soap/interop/client_round2_interop.php b/ext/soap/interop/client_round2_interop.php index fd5767cc17..bd52f28771 100644 --- a/ext/soap/interop/client_round2_interop.php +++ b/ext/soap/interop/client_round2_interop.php @@ -93,7 +93,7 @@ class Interop_Client function _fetchEndpoints(&$soapclient, $test) { $this->_getEndpoints($test, 1); - // retreive endpoints from the endpoint server + // retrieve endpoints from the endpoint server $endpointArray = $soapclient->__soapCall("GetEndpointInfo",array("groupName"=>$test),array('soapaction'=>"http://soapinterop.org/",'uri'=>"http://soapinterop.org/")); if (is_soap_fault($endpointArray) || PEAR::isError($endpointArray)) { if ($this->html) print "<pre>"; @@ -133,7 +133,7 @@ class Interop_Client /** * fetchEndpoints - * retreive endpoints interop server + * retrieve endpoints interop server * * @return boolean result * @access private @@ -158,7 +158,7 @@ class Interop_Client } return NULL; } - // retreive all endpoints now + // retrieve all endpoints now $this->currentTest = $test; $x = $this->_getEndpoints($test); return $x; @@ -166,7 +166,7 @@ class Interop_Client /** * getEndpoints - * retreive endpoints from either database or interop server + * retrieve endpoints from either database or interop server * * @param string base (see local var $tests) * @param boolean all (if false, only get valid endpoints, status=1) @@ -182,7 +182,7 @@ class Interop_Client /** * _getEndpoints - * retreive endpoints from database + * retrieve endpoints from database * * @param string base (see local var $tests) * @param boolean all (if false, only get valid endpoints, status=1) @@ -222,7 +222,7 @@ class Interop_Client /** * getResults - * retreive results from the database, stuff them into the endpoint array + * retrieve results from the database, stuff them into the endpoint array * * @access private */ @@ -230,7 +230,7 @@ class Interop_Client // be sure we have the right endpoints for this test result $this->getEndpoints($test); - // retreive the results and put them into the endpoint info + // retrieve the results and put them into the endpoint info $sql = "select * from results where class='$test' and type='$type' and wsdl=$wsdl"; $results = $this->dbc->getAll($sql,NULL, DB_FETCHMODE_ASSOC ); foreach ($results as $result) { @@ -657,12 +657,12 @@ try { /** * getResults - * retreive results from the database, stuff them into the endpoint array + * retrieve results from the database, stuff them into the endpoint array * * @access private */ function getMethodList($test = 'base') { - // retreive the results and put them into the endpoint info + // retrieve the results and put them into the endpoint info $sql = "select distinct(function) from results where class='$test' order by function"; $results = $this->dbc->getAll($sql); $ar = array(); diff --git a/ext/soap/package.xml b/ext/soap/package.xml index e43fd36024..6c68f8dd4c 100644 --- a/ext/soap/package.xml +++ b/ext/soap/package.xml @@ -34,7 +34,7 @@ <date>2002-07-07</date> <state>alpha</state> <notes> - - First offical PEAR/PECL release + - First official PEAR/PECL release </notes> </release> <filelist> diff --git a/ext/soap/php_sdl.h b/ext/soap/php_sdl.h index cf6e26b179..9ecf40c067 100644 --- a/ext/soap/php_sdl.h +++ b/ext/soap/php_sdl.h @@ -87,7 +87,7 @@ struct _sdlBinding { void *bindingAttributes; /* sdlSoapBindingPtr */ }; -/* Soap Binding Specfic stuff */ +/* Soap Binding Specific stuff */ struct _sdlSoapBinding { sdlEncodingStyle style; sdlTransport transport; /* not implemented yet */ diff --git a/ext/soap/php_soap.h b/ext/soap/php_soap.h index 6d36792981..f32555cd93 100644 --- a/ext/soap/php_soap.h +++ b/ext/soap/php_soap.h @@ -92,7 +92,7 @@ struct _soapService { zend_class_entry *ce; zval *argv; int argc; - int persistance; + int persistence; } soap_class; zval soap_object; diff --git a/ext/soap/soap.c b/ext/soap/soap.c index 2b37622a7a..0e7d004564 100644 --- a/ext/soap/soap.c +++ b/ext/soap/soap.c @@ -1259,7 +1259,7 @@ PHP_METHOD(SoapServer, setPersistence) if (service->type == SOAP_CLASS) { if (value == SOAP_PERSISTENCE_SESSION || value == SOAP_PERSISTENCE_REQUEST) { - service->soap_class.persistance = value; + service->soap_class.persistence = value; } else { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Tried to set persistence with bogus value (%pd)", value); return; @@ -1299,7 +1299,7 @@ PHP_METHOD(SoapServer, setClass) service->type = SOAP_CLASS; service->soap_class.ce = ce; - service->soap_class.persistance = SOAP_PERSISTENCE_REQUEST; + service->soap_class.persistence = SOAP_PERSISTENCE_REQUEST; service->soap_class.argc = num_args; if (service->soap_class.argc > 0) { int i; @@ -1657,7 +1657,7 @@ PHP_METHOD(SoapServer, handle) } else if (service->type == SOAP_CLASS) { #if HAVE_PHP_SESSION && !defined(COMPILE_DL_SESSION) /* If persistent then set soap_obj from from the previous created session (if available) */ - if (service->soap_class.persistance == SOAP_PERSISTENCE_SESSION) { + if (service->soap_class.persistence == SOAP_PERSISTENCE_SESSION) { zval *tmp_soap; zval *session_vars; @@ -1741,7 +1741,7 @@ PHP_METHOD(SoapServer, handle) } #if HAVE_PHP_SESSION && !defined(COMPILE_DL_SESSION) /* If session then update session hash with new object */ - if (service->soap_class.persistance == SOAP_PERSISTENCE_SESSION) { + if (service->soap_class.persistence == SOAP_PERSISTENCE_SESSION) { zval *tmp_soap_pp; zval *session_vars = &PS(http_session_vars); @@ -1848,7 +1848,7 @@ PHP_METHOD(SoapServer, handle) call_status = call_user_function(NULL, soap_obj, &function_name, &retval, num_params, params TSRMLS_CC); if (service->type == SOAP_CLASS) { #if HAVE_PHP_SESSION && !defined(COMPILE_DL_SESSION) - if (service->soap_class.persistance != SOAP_PERSISTENCE_SESSION) { + if (service->soap_class.persistence != SOAP_PERSISTENCE_SESSION) { zval_ptr_dtor(soap_obj); soap_obj = NULL; } @@ -1875,7 +1875,7 @@ PHP_METHOD(SoapServer, handle) } if (service->type == SOAP_CLASS) { #if HAVE_PHP_SESSION && !defined(COMPILE_DL_SESSION) - if (soap_obj && service->soap_class.persistance != SOAP_PERSISTENCE_SESSION) { + if (soap_obj && service->soap_class.persistence != SOAP_PERSISTENCE_SESSION) { #else if (soap_obj) { #endif @@ -1919,7 +1919,7 @@ PHP_METHOD(SoapServer, handle) } if (service->type == SOAP_CLASS) { #if HAVE_PHP_SESSION && !defined(COMPILE_DL_SESSION) - if (soap_obj && service->soap_class.persistance != SOAP_PERSISTENCE_SESSION) { + if (soap_obj && service->soap_class.persistence != SOAP_PERSISTENCE_SESSION) { #else if (soap_obj) { #endif @@ -3113,7 +3113,7 @@ PHP_METHOD(SoapClient, __doRequest) /* {{{ proto void SoapClient::__setCookie(string name [, strung value]) Sets cookie thet will sent with SOAP request. - The call to this function will effect all folowing calls of SOAP methods. + The call to this function will effect all following calls of SOAP methods. If value is not specified cookie is removed. */ PHP_METHOD(SoapClient, __setCookie) { @@ -4711,6 +4711,7 @@ static void type_to_string(sdlTypePtr type, smart_str *buf, int level) if (type->attributes && (attr = zend_hash_str_find_ptr(type->attributes, SOAP_1_1_ENC_NAMESPACE":arrayType", sizeof(SOAP_1_1_ENC_NAMESPACE":arrayType")-1)) != NULL && + attr->extraAttributes && (ext = zend_hash_str_find_ptr(attr->extraAttributes, WSDL_NAMESPACE":arrayType", sizeof(WSDL_NAMESPACE":arrayType")-1)) != NULL) { char *end = strchr(ext->val, '['); int len; @@ -4734,6 +4735,7 @@ static void type_to_string(sdlTypePtr type, smart_str *buf, int level) if (type->attributes && (attr = zend_hash_str_find_ptr(type->attributes, SOAP_1_2_ENC_NAMESPACE":itemType", sizeof(SOAP_1_2_ENC_NAMESPACE":itemType")-1)) != NULL && + attr->extraAttributes && (ext = zend_hash_str_find_ptr(attr->extraAttributes, WSDL_NAMESPACE":itemType", sizeof(WSDL_NAMESPACE":arrayType")-1)) != NULL) { smart_str_appends(buf, ext->val); smart_str_appendc(buf, ' '); @@ -4751,6 +4753,7 @@ static void type_to_string(sdlTypePtr type, smart_str *buf, int level) if (type->attributes && (attr = zend_hash_str_find_ptr(type->attributes, SOAP_1_2_ENC_NAMESPACE":arraySize", sizeof(SOAP_1_2_ENC_NAMESPACE":arraySize")-1)) != NULL && + attr->extraAttributes && (ext = zend_hash_str_find_ptr(attr->extraAttributes, WSDL_NAMESPACE":itemType", sizeof(WSDL_NAMESPACE":arraySize")-1)) != NULL) { smart_str_appendc(buf, '['); smart_str_appends(buf, ext->val); diff --git a/ext/soap/tests/bug68361.phpt b/ext/soap/tests/bug68361.phpt new file mode 100644 index 0000000000..6dbba8a425 --- /dev/null +++ b/ext/soap/tests/bug68361.phpt @@ -0,0 +1,114 @@ +--TEST-- +Bug #68361 Segmentation fault on SoapClient::__getTypes +--SKIPIF-- +<?php require_once('skipif.inc'); ?> +--FILE-- +<?php + +$xml = <<<XML +<?xml version="1.0" encoding="UTF-8"?> +<definitions name="TestServer" targetNamespace="http://foo.bar/testserver" xmlns:tns="http://foo.bar/testserver" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:ns="http://foo.bar/testserver/types"> + <types> + <xsd:schema targetNamespace="http://foo.bar/testserver/types" xmlns="http://foo.bar/testserver/types"> + <xsd:complexType name="ArrayOfEmployeeReturn"> + <xsd:complexContent> + <xsd:restriction base="soapenc:Array"> + <xsd:attribute ref="soapenc:arrayType" arrayType="ns:Employee[]"/> + </xsd:restriction> + </xsd:complexContent> + </xsd:complexType> + <xsd:complexType name="Employee"> + <xsd:sequence> + <xsd:element name="id" type="xsd:int"/> + <xsd:element name="department" type="xsd:string"/> + <xsd:element name="name" type="xsd:string"/> + <xsd:element name="age" type="xsd:int"/> + </xsd:sequence> + </xsd:complexType> + <xsd:element name="Employee" nillable="true" type="ns:Employee"/> + <xsd:complexType name="User"> + <xsd:sequence> + <xsd:element name="name" type="xsd:string"/> + <xsd:element name="age" type="xsd:int"/> + </xsd:sequence> + </xsd:complexType> + <xsd:element name="User" nillable="true" type="ns:User"/> + </xsd:schema> + </types> + <message name="getEmployeeRequest"> + <part name="name" type="xsd:name"/> + </message> + <message name="getEmployeeResponse"> + <part name="employeeReturn" type="ns:ArrayOfEmployeeReturn"/> + </message> + <message name="getUserRequest"> + <part name="id" type="xsd:id"/> + </message> + <message name="getUserResponse"> + <part name="userReturn" element="ns:User"/> + </message> + <portType name="TestServerPortType"> + <operation name="getEmployee"> + <input message="tns:getEmployeeRequest"/> + <output message="tns:getEmployeeResponse"/> + </operation> + <operation name="getUser"> + <input message="tns:getUserRequest"/> + <output message="tns:getUserResponse"/> + </operation> + </portType> + <binding name="TestServerBinding" type="tns:TestServerPortType"> + <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/> + <operation name="getEmployee"> + <soap:operation soapAction="http://foo.bar/testserver/#getEmployee"/> + <input> + <soap:body use="literal" namespace="http://foo.bar/testserver"/> + </input> + <output> + <soap:body use="literal" namespace="http://foo.bar/testserver"/> + </output> + </operation> + <operation name="getUser"> + <soap:operation soapAction="http://foo.bar/testserver/#getUser"/> + <input> + <soap:body use="literal" namespace="http://foo.bar/testserver"/> + </input> + <output> + <soap:body use="literal" namespace="http://foo.bar/testserver"/> + </output> + </operation> + </binding> + <service name="TestServerService"> + <port name="TestServerPort" binding="tns:TestServerBinding"> + <soap:address location="http://localhost/wsdl-creator/TestClass.php"/> + </port> + </service> +</definitions> +XML; + +file_put_contents(__DIR__ . "/bug68361.xml", $xml); +$client = new SoapClient(__DIR__ . "/bug68361.xml"); + +$res = $client->__getTypes(); // Segmentation fault here + +print_r($res); +?> +--CLEAN-- +<?php +unlink(__DIR__ . "/bug68361.xml"); +?> +--EXPECT-- +Array +( + [0] => anyType ArrayOfEmployeeReturn[] + [1] => struct Employee { + int id; + string department; + string name; + int age; +} + [2] => struct User { + string name; + int age; +} +) diff --git a/ext/soap/tests/bugs/bug27742.wsdl b/ext/soap/tests/bugs/bug27742.wsdl index 7f1514acbf..a9429981c3 100644 --- a/ext/soap/tests/bugs/bug27742.wsdl +++ b/ext/soap/tests/bugs/bug27742.wsdl @@ -726,7 +726,7 @@ </element>
<element name="genres">
<annotation>
- <documentation xml:lang="en">Containes genre information where available for the program records. A program may have more than one genre with different relevence factors.</documentation>
+ <documentation xml:lang="en">Contains genre information where available for the program records. A program may have more than one genre with different relevance factors.</documentation>
</annotation>
<complexType>
<sequence maxOccurs="unbounded">
@@ -749,7 +749,7 @@ </element>
<element name="relevance" type="xsd:int">
<annotation>
- <documentation xml:lang="en">A relevence factor that applies to the genre classification for the program. A relevence factor of 1 indicates that this is the top-level genre under which the program is classified.</documentation>
+ <documentation xml:lang="en">A relevance factor that applies to the genre classification for the program. A relevance factor of 1 indicates that this is the top-level genre under which the program is classified.</documentation>
</annotation>
</element>
</sequence>
diff --git a/ext/soap/tests/bugs/bug50698_2.phpt b/ext/soap/tests/bugs/bug50698_2.phpt index a39f4b56bf..7ff667423c 100644 --- a/ext/soap/tests/bugs/bug50698_2.phpt +++ b/ext/soap/tests/bugs/bug50698_2.phpt @@ -1,5 +1,5 @@ --TEST-- -Request #50698_2 (SoapClient should handle wsdls with some incompatiable endpoints -- EDGECASE: Large mix of compatiable and incompatiable endpoints.) +Request #50698_2 (SoapClient should handle wsdls with some incompatiable endpoints -- EDGECASE: Large mix of compatible and incompatiable endpoints.) --SKIPIF-- <?php require_once('skipif.inc'); ?> --INI-- |
