DOMElement). (Rob)
- Fixed bug #42452 (PDO classes do not expose Reflection API information).
(Hannes)
+- Fixed bug #42326 (SoapServer crash). (Dmitry)
30 Aug 2007, PHP 5.2.4
- Removed --enable-versioning configure option. (Jani)
return 0;
}
-xmlNodePtr master_to_xml(encodePtr encode, zval *data, int style, xmlNodePtr parent)
+static xmlNodePtr master_to_xml_int(encodePtr encode, zval *data, int style, xmlNodePtr parent, int check_class_map)
{
xmlNodePtr node = NULL;
TSRMLS_FETCH();
xmlSetNs(node, nsp);
}
} else {
- if (SOAP_GLOBAL(class_map) && data &&
+ if (check_class_map && SOAP_GLOBAL(class_map) && data &&
Z_TYPE_P(data) == IS_OBJECT &&
!Z_OBJPROP_P(data)->nApplyCount) {
zend_class_entry *ce = Z_OBJCE_P(data);
return node;
}
+xmlNodePtr master_to_xml(encodePtr encode, zval *data, int style, xmlNodePtr parent)
+{
+ return master_to_xml_int(encode, data, style, parent, 1);
+}
+
static zval *master_to_zval_int(encodePtr encode, xmlNodePtr data)
{
zval *ret = NULL;
} else {
enc = get_conversion(IS_NULL);
}
- ret = master_to_xml(enc, data, style, parent);
+ ret = master_to_xml_int(enc, data, style, parent, 0);
/*
if (style == SOAP_LITERAL && SOAP_GLOBAL(sdl)) {
set_ns_and_type(ret, &enc->details);
--- /dev/null
+--TEST--
+Bug #42326 (SoapServer crash)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$request = <<<EOF
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://www.example.com/"><SOAP-ENV:Body><ns1:GetProductsRequest><time></time></ns1:GetProductsRequest></SOAP-ENV:Body></SOAP-ENV:Envelope>
+EOF;
+
+
+$soap_admin_classmap = array('productDetailsType' => 'SOAP_productDetailsType',
+ 'GetProductsRequest' => 'SOAP_GetProductsRequest',
+ 'GetProductsResponse' => 'SOAP_GetProductsResponse');
+
+class SOAP_productDetailsType {
+ public $id = 0;
+}
+
+class SOAP_GetProductsRequest {
+ public $time = '';
+}
+
+class SOAP_GetProductsResponse {
+ public $products;
+ function __construct(){
+ $this->products = new SOAP_productDetailsType();
+
+ }
+}
+
+class SOAP_Admin {
+ public function GetProducts($time){
+ return new SOAP_GetProductsResponse();
+ }
+}
+
+$soap = new SoapServer(dirname(__FILE__).'/bug42326.wsdl', array('classmap' => $soap_admin_classmap));
+$soap->setClass('SOAP_Admin');
+ob_start();
+$soap->handle($request);
+ob_end_clean();
+echo "ok\n";
+?>
+--EXPECT--
+ok
--- /dev/null
+<?xml version="1.0"?>\r
+<wsdl:definitions name="OSCAdmin.wsdl"\r
+targetNamespace="http://www.example.com/"\r
+xmlns:tns="http://www.example.com/"\r
+xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"\r
+xmlns:xsd="http://www.w3.org/2001/XMLSchema"\r
+xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"> \r
+ <wsdl:types>\r
+\r
+ <xsd:schema targetNamespace="http://www.example.com/"\r
+ xmlns="http://www.w3.org/2000/10/XMLSchema">\r
+ <xsd:element name="productDetailsType">\r
+ <xsd:complexType>\r
+ <xsd:all>\r
+ <xsd:element name="id" type="xsd:integer"/>\r
+ \r
+ </xsd:all>\r
+ </xsd:complexType>\r
+ </xsd:element>\r
+ </xsd:schema>\r
+\r
+\r
+ <xsd:schema targetNamespace="http://www.example.com/"\r
+ xmlns="http://www.w3.org/2000/10/XMLSchema">\r
+ <xsd:element name="GetProductsRequest">\r
+ <xsd:complexType>\r
+ <xsd:all>\r
+ <xsd:element name="time" type="xsd:string"/>\r
+ </xsd:all>\r
+ </xsd:complexType>\r
+ </xsd:element>\r
+ </xsd:schema>\r
+\r
+ <xsd:schema targetNamespace="http://www.example.com/"\r
+ xmlns="http://www.w3.org/2000/10/XMLSchema">\r
+ <xsd:element name="GetProductsResponse">\r
+ <xsd:complexType>\r
+ <xsd:all>\r
+ <xsd:element name="products" type="tns:productDetailsType"/>\r
+ </xsd:all>\r
+ </xsd:complexType>\r
+ </xsd:element>\r
+ </xsd:schema>\r
+\r
+ \r
+ </wsdl:types>\r
+\r
+ <wsdl:message name="GetProductsRequest">\r
+ <wsdl:part name="in" element="tns:GetProductsRequest"/>\r
+ </wsdl:message>\r
+\r
+ <wsdl:message name="GetProductsResponse">\r
+ <wsdl:part name="out" element="tns:GetProductsResponse"/>\r
+ </wsdl:message>\r
+\r
+ <wsdl:portType name="OSCAdminPortType">\r
+ <wsdl:operation name="GetProducts">\r
+ <wsdl:input message="tns:GetProductsRequest"/>\r
+ <wsdl:output message="tns:GetProductsResponse"/>\r
+ </wsdl:operation>\r
+ </wsdl:portType>\r
+\r
+ <wsdl:binding name="OSCAdminSoapBinding" type="tns:OSCAdminPortType">\r
+ <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>\r
+ <wsdl:operation name="GetProducts">\r
+ <soap:operation soapAction=""/>\r
+ <wsdl:input name="in">\r
+ <soap:body use="literal"/>\r
+ </wsdl:input>\r
+ <wsdl:output name="out">\r
+ <soap:body use="literal"/>\r
+ </wsdl:output>\r
+ </wsdl:operation>\r
+ </wsdl:binding>\r
+\r
+ <wsdl:service name="OSCAdminService">\r
+ <wsdl:port name="OSCAdminPort" binding="tns:OSCAdminSoapBinding">\r
+ <soap:address location="test://"/>\r
+ </wsdl:port>\r
+ </wsdl:service>\r
+\r
+</wsdl:definitions>
\ No newline at end of file