File tree Expand file tree Collapse file tree 3 files changed +40
-5
lines changed Expand file tree Collapse file tree 3 files changed +40
-5
lines changed Original file line number Diff line number Diff line change @@ -37,6 +37,10 @@ PHP NEWS
37
37
. Fixed bug #73087, #61183, #71494 (Memory corruption in bindParam).
38
38
(Dorin Marcoci)
39
39
40
+ - Soap:
41
+ . Fixed bug #73538 (SoapClient::__setSoapHeaders doesn't overwrite SOAP
42
+ headers). (duncan3dc)
43
+
40
44
- SPL:
41
45
. Fixed bug #73423 (Reproducible crash with GDB backtrace). (Laruence)
42
46
Original file line number Diff line number Diff line change @@ -3209,12 +3209,8 @@ PHP_METHOD(SoapClient, __setSoapHeaders)
3209
3209
if (headers == NULL || Z_TYPE_P (headers ) == IS_NULL ) {
3210
3210
zend_hash_str_del (Z_OBJPROP_P (this_ptr ), "__default_headers" , sizeof ("__default_headers" )- 1 );
3211
3211
} else if (Z_TYPE_P (headers ) == IS_ARRAY ) {
3212
- zval * default_headers ;
3213
-
3214
3212
verify_soap_headers_array (Z_ARRVAL_P (headers ));
3215
- if ((default_headers = zend_hash_str_find (Z_OBJPROP_P (this_ptr ), "__default_headers" , sizeof ("__default_headers" )- 1 )) == NULL ) {
3216
- add_property_zval (this_ptr , "__default_headers" , headers );
3217
- }
3213
+ add_property_zval (this_ptr , "__default_headers" , headers );
3218
3214
} else if (Z_TYPE_P (headers ) == IS_OBJECT &&
3219
3215
instanceof_function (Z_OBJCE_P (headers ), soap_header_class_entry )) {
3220
3216
zval default_headers ;
Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ SOAP: SoapClient::__setHeaders array overrides previous headers
3
+ --SKIPIF--
4
+ <?php require_once ('skipif.inc ' ); ?>
5
+ --FILE--
6
+ <?php
7
+
8
+ $ client = new SoapClient (null , [
9
+ "location " => "test:// " ,
10
+ "uri " => "test:// " ,
11
+ "exceptions " => false ,
12
+ "trace " => true ,
13
+ ]);
14
+ $ client ->__setSoapHeaders (new \SoapHeader ('ns ' , 'Header ' , ['something ' => 1 ]));
15
+ $ client ->__setSoapHeaders (new \SoapHeader ('ns ' , 'Header ' , ['something ' => 2 ]));
16
+ $ client ->test ();
17
+ echo $ client ->__getLastRequest ();
18
+
19
+ $ client = new SoapClient (null , [
20
+ "location " => "test:// " ,
21
+ "uri " => "test:// " ,
22
+ "exceptions " => false ,
23
+ "trace " => true ,
24
+ ]);
25
+ $ client ->__setSoapHeaders ([new \SoapHeader ('ns ' , 'Header ' , ['something ' => 1 ])]);
26
+ $ client ->__setSoapHeaders ([new \SoapHeader ('ns ' , 'Header ' , ['something ' => 2 ])]);
27
+ $ client ->test ();
28
+ echo $ client ->__getLastRequest ();
29
+
30
+ ?>
31
+ --EXPECT--
32
+ <? xml version="1.0 " encoding="UTF -8 "?>
33
+ <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="test://" xmlns:ns2="ns" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Header><ns2:Header><item><key>something</key><value>2</value></item></ns2:Header></SOAP-ENV:Header><SOAP-ENV:Body><ns1:test/></SOAP-ENV:Body></SOAP-ENV:Envelope>
34
+ <? xml version="1.0 " encoding="UTF -8 "?>
35
+ <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="test://" xmlns:ns2="ns" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Header><ns2:Header><item><key>something</key><value>2</value></item></ns2:Header></SOAP-ENV:Header><SOAP-ENV:Body><ns1:test/></SOAP-ENV:Body></SOAP-ENV:Envelope>
You can’t perform that action at this time.
0 commit comments