Skip to content

Commit f80d26e

Browse files
committed
Fixed bug #46427 (SoapClient() stumbles over its "stream_context" parameter)
1 parent b388624 commit f80d26e

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

ext/soap/soap.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2522,6 +2522,7 @@ PHP_METHOD(SoapClient, SoapClient)
25222522
if (zend_hash_find(ht, "stream_context", sizeof("stream_context"), (void**)&tmp) == SUCCESS &&
25232523
Z_TYPE_PP(tmp) == IS_RESOURCE) {
25242524
context = php_stream_context_from_zval(*tmp, 1);
2525+
zend_list_addref(context->rsrc_id);
25252526
}
25262527

25272528
if (zend_hash_find(ht, "location", sizeof("location"), (void**)&tmp) == SUCCESS &&

ext/soap/tests/bugs/bug46427.phpt

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
--TEST--
2+
Bug #46427 (SoapClient() stumbles over its "stream_context" parameter)
3+
--FILE--
4+
<?php
5+
error_reporting(E_ALL|E_STRICT);
6+
7+
function getSoapClient_1() {
8+
$ctx = stream_context_create();
9+
return new SoapClient(NULL, array(
10+
'stream_context' => $ctx,
11+
'location' => 'test://',
12+
'uri' => 'test://',
13+
'exceptions' => false));
14+
}
15+
16+
getSoapClient_1()->__soapCall('Help', array());
17+
echo "ok\n";
18+
?>
19+
--EXPECT--
20+
ok

0 commit comments

Comments
 (0)