Skip to content

Commit 794a288

Browse files
committed
Merge branch 'PHP-5.6'
Conflicts: ext/soap/soap.c
2 parents 8f5676f + 4119879 commit 794a288

File tree

2 files changed

+20
-3
lines changed

2 files changed

+20
-3
lines changed

ext/soap/soap.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2581,7 +2581,7 @@ static int do_request(zval *this_ptr, xmlDoc *request, char *location, char *act
25812581
}
25822582

25832583
if ((trace = zend_hash_str_find(Z_OBJPROP_P(this_ptr), "trace", sizeof("trace")-1)) != NULL &&
2584-
Z_LVAL_P(trace) > 0) {
2584+
Z_TYPE_P(trace) == IS_LONG && Z_LVAL_P(trace) > 0) {
25852585
add_property_stringl(this_ptr, "__last_request", buf, buf_size);
25862586
}
25872587

@@ -2609,7 +2609,7 @@ static int do_request(zval *this_ptr, xmlDoc *request, char *location, char *act
26092609
}
26102610
ret = FALSE;
26112611
} else if ((trace = zend_hash_str_find(Z_OBJPROP_P(this_ptr), "trace", sizeof("trace")-1)) != NULL &&
2612-
Z_LVAL_P(trace) > 0) {
2612+
Z_TYPE_P(trace) == IS_LONG && Z_LVAL_P(trace) > 0) {
26132613
add_property_str(this_ptr, "__last_response", zend_string_copy(Z_STR_P(response)));
26142614
}
26152615
zval_ptr_dtor(&func);
@@ -2909,7 +2909,7 @@ PHP_METHOD(SoapClient, __call)
29092909

29102910
/* Add default headers */
29112911
this_ptr = getThis();
2912-
if ((tmp = zend_hash_str_find(Z_OBJPROP_P(this_ptr), "__default_headers", sizeof("__default_headers")-1)) != NULL) {
2912+
if ((tmp = zend_hash_str_find(Z_OBJPROP_P(this_ptr), "__default_headers", sizeof("__default_headers")-1)) != NULL && Z_TYPE_P(tmp) == IS_ARRAY) {
29132913
HashTable *default_headers = Z_ARRVAL_P(tmp);
29142914
if (soap_headers) {
29152915
if (!free_soap_headers) {

ext/soap/tests/bugs/bug69085.phpt

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
--TEST--
2+
Bug #69085 (SoapClient's __call() type confusion through unserialize())
3+
--SKIPIF--
4+
<?php require_once('skipif.inc'); ?>
5+
--INI--
6+
soap.wsdl_cache_enabled=0
7+
--FILE--
8+
<?php
9+
10+
$dummy = unserialize('O:10:"SoapClient":5:{s:3:"uri";s:1:"a";s:8:"location";s:22:"http://localhost/a.xml";s:17:"__default_headers";i:1337;s:15:"__last_response";s:1:"a";s:5:"trace";s:1:"x";}');
11+
try {
12+
$dummy->whatever();
13+
} catch (Exception $e) {
14+
echo "okey";
15+
}
16+
--EXPECT--
17+
okey

0 commit comments

Comments
 (0)