Skip to content

Commit 6a68331

Browse files
committed
Fix GH-22218: SoapServer::handle() crash on non-array $_SERVER.
add reproducer. Fix #22218
1 parent 092fd61 commit 6a68331

1 file changed

Lines changed: 27 additions & 0 deletions

File tree

ext/soap/tests/gh22218.phpt

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
--TEST--
2+
GH-22218 (SoapServer::handle() segfault on non-array/unset $_SERVER)
3+
--EXTENSIONS--
4+
soap
5+
--CREDITS--
6+
Rex-Reynolds
7+
--SKIPIF--
8+
<?php
9+
if (php_sapi_name() == 'cli') echo 'skip needs request body (POST)';
10+
?>
11+
--POST--
12+
<SOAP-ENV:Envelope
13+
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
14+
<SOAP-ENV:Body>
15+
<test/>
16+
</SOAP-ENV:Body>
17+
</SOAP-ENV:Envelope>
18+
--FILE--
19+
<?php
20+
$_SERVER = 79;
21+
$server = new SoapServer(null, ['uri' => 'http://test-uri']);
22+
$server->handle();
23+
echo "ALIVE\n";
24+
?>
25+
--EXPECTF--
26+
%A
27+
ALIVE

0 commit comments

Comments
 (0)