1
0
mirror of https://github.com/php/php-src.git synced 2026-04-21 15:08:16 +02:00
Files
archived-php-src/ext/soap/tests/bug68996.phpt
T
Max Semenik 7f2f0c007c Migrate skip checks to --EXTENSIONS--, p4
For rationale, see #6787

Extensions migrated in part 4:
* simplexml
* skeleton
* soap
* spl
* sqlite3
* sysvmsg
* sysvsem
* tidy - also removed a check for an ancient dependency version
2021-04-08 10:36:44 +02:00

48 lines
1.4 KiB
PHP

--TEST--
Bug #68996 (Invalid free of CG(interned_empty_string))
--EXTENSIONS--
soap
--SKIPIF--
<?php
if (getenv("USE_ZEND_ALLOC") !== "0")
print "skip Need Zend MM disabled";
?>
--FILE--
<?php
$s = new SoapServer(NULL, [
'uri' => 'http://foo',
]);
function foo() {
return new SoapFault("\xfc\x63", "some msg");
}
$s->addFunction("foo");
// soap 1.1
$HTTP_RAW_POST_DATA = <<<EOF
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<SOAP-ENV:foo />
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
EOF;
$s->handle($HTTP_RAW_POST_DATA);
// soap 1.2
$HTTP_RAW_POST_DATA = <<<EOF
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
<env:Body>
<env:foo />
</env:Body>
</env:Envelope>
EOF;
$s->handle($HTTP_RAW_POST_DATA);
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode></faultcode><faultstring>some msg</faultstring></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Body><env:Fault><env:Code><env:Value></env:Value></env:Code><env:Reason><env:Text>some msg</env:Text></env:Reason></env:Fault></env:Body></env:Envelope>