mirror of
https://github.com/php/php-src.git
synced 2024-09-22 10:27:25 +00:00
Fixed bug #28751 (SoapServer does not call _autoload())
This commit is contained in:
parent
ea5dc3d577
commit
8ad22e4279
1
NEWS
1
NEWS
@ -1,6 +1,7 @@
|
||||
PHP NEWS
|
||||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||
?? Jul 2004, PHP 5.0.0
|
||||
- Fixed bug #28751 (SoapServer does not call _autoload()). (Dmitry)
|
||||
- Updated PCRE to provide better error handling in certain cases. (Andrei)
|
||||
- Changed doc comments to require a single white space after '/**'. (Marcus)
|
||||
- Fixed bug #29019 (Database not closing). (Marcus)
|
||||
|
@ -998,8 +998,11 @@ PHP_METHOD(SoapServer, setPersistence)
|
||||
PHP_METHOD(SoapServer, setClass)
|
||||
{
|
||||
soapServicePtr service;
|
||||
#ifdef ZEND_ENGINE_2
|
||||
zend_class_entry **ce;
|
||||
#else
|
||||
zend_class_entry *ce;
|
||||
char *class_name = NULL;
|
||||
#endif
|
||||
int found, argc;
|
||||
zval ***argv;
|
||||
|
||||
@ -1016,14 +1019,17 @@ PHP_METHOD(SoapServer, setClass)
|
||||
}
|
||||
|
||||
if (Z_TYPE_PP(argv[0]) == IS_STRING) {
|
||||
class_name = estrdup(Z_STRVAL_PP(argv[0]));
|
||||
|
||||
#ifdef ZEND_ENGINE_2
|
||||
found = zend_lookup_class(Z_STRVAL_PP(argv[0]), Z_STRLEN_PP(argv[0]), &ce);
|
||||
#else
|
||||
char *class_name = estrdup(Z_STRVAL_PP(argv[0]));
|
||||
found = zend_hash_find(EG(class_table), php_strtolower(class_name, Z_STRLEN_PP(argv[0])), Z_STRLEN_PP(argv[0]) + 1, (void **)&ce);
|
||||
efree(class_name);
|
||||
#endif
|
||||
if (found != FAILURE) {
|
||||
service->type = SOAP_CLASS;
|
||||
#ifdef ZEND_ENGINE_2
|
||||
service->soap_class.ce = *(zend_class_entry**)ce;
|
||||
service->soap_class.ce = *ce;
|
||||
#else
|
||||
service->soap_class.ce = ce;
|
||||
#endif
|
||||
|
38
ext/soap/tests/bugs/bug28751.phpt
Normal file
38
ext/soap/tests/bugs/bug28751.phpt
Normal file
@ -0,0 +1,38 @@
|
||||
--TEST--
|
||||
Bug #28751 (SoapServer does not call _autoload())
|
||||
--SKIPIF--
|
||||
<?php require_once('skipif.inc'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
function __autoload($className) {
|
||||
class SoapServerActions {
|
||||
function test() {
|
||||
return "Hello World";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$server = new SoapServer(NULL, array('uri'=>"http://testuri.org"));
|
||||
$server->setClass("SoapServerActions");
|
||||
|
||||
$HTTP_RAW_POST_DATA = <<<EOF
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<SOAP-ENV:Envelope
|
||||
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
|
||||
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
|
||||
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:si="http://soapinterop.org/xsd">
|
||||
<SOAP-ENV:Body>
|
||||
<ns1:test xmlns:ns1="http://testuri.org" />
|
||||
</SOAP-ENV:Body>
|
||||
</SOAP-ENV:Envelope>
|
||||
EOF;
|
||||
|
||||
$server->handle();
|
||||
echo "ok\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://testuri.org" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:testResponse><return xsi:type="xsd:string">Hello World</return></ns1:testResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
|
||||
ok
|
3
ext/soap/tests/bugs/skipif.inc
Normal file
3
ext/soap/tests/bugs/skipif.inc
Normal file
@ -0,0 +1,3 @@
|
||||
<?php
|
||||
if (!extension_loaded('soap')) die('skip soap extension not available');
|
||||
?>
|
Loading…
Reference in New Issue
Block a user