@@ -2563,7 +2563,7 @@ static int do_request(zval *this_ptr, xmlDoc *request, char *location, char *act
25632563 }
25642564
25652565 if (zend_hash_find (Z_OBJPROP_P (this_ptr ), "trace" , sizeof ("trace" ), (void * * ) & trace ) == SUCCESS &&
2566- Z_TYPE_PP ( trace ) == IS_LONG && Z_LVAL_PP (trace ) > 0 ) {
2566+ ( Z_LVAL_PP ( trace ) == IS_BOOL || Z_LVAL_PP ( trace ) == IS_LONG ) && Z_LVAL_PP (trace ) != 0 ) {
25672567 add_property_stringl (this_ptr , "__last_request" , buf , buf_size , 1 );
25682568 }
25692569
@@ -2598,7 +2598,7 @@ static int do_request(zval *this_ptr, xmlDoc *request, char *location, char *act
25982598 }
25992599 ret = FALSE;
26002600 } else if (zend_hash_find (Z_OBJPROP_P (this_ptr ), "trace" , sizeof ("trace" ), (void * * ) & trace ) == SUCCESS &&
2601- Z_TYPE_PP ( trace ) == IS_LONG && Z_LVAL_PP (trace ) > 0 ) {
2601+ ( Z_LVAL_PP ( trace ) == IS_BOOL || Z_LVAL_PP ( trace ) == IS_LONG ) && Z_LVAL_PP (trace ) != 0 ) {
26022602 add_property_stringl (this_ptr , "__last_response" , Z_STRVAL_P (response ), Z_STRLEN_P (response ), 1 );
26032603 }
26042604 zval_ptr_dtor (& params [4 ]);
@@ -2642,13 +2642,13 @@ static void do_soap_call(zval* this_ptr,
26422642
26432643 SOAP_CLIENT_BEGIN_CODE ();
26442644
2645- if (zend_hash_find (Z_OBJPROP_P (this_ptr ), "trace" , sizeof ("trace" ), (void * * ) & trace ) == SUCCESS
2646- && Z_LVAL_PP (trace ) > 0 ) {
2645+ if (zend_hash_find (Z_OBJPROP_P (this_ptr ), "trace" , sizeof ("trace" ), (void * * ) & trace ) == SUCCESS &&
2646+ ( Z_LVAL_PP ( trace ) == IS_BOOL || Z_LVAL_PP ( trace ) == IS_LONG ) && Z_LVAL_PP (trace ) != 0 ) {
26472647 zend_hash_del (Z_OBJPROP_P (this_ptr ), "__last_request" , sizeof ("__last_request" ));
26482648 zend_hash_del (Z_OBJPROP_P (this_ptr ), "__last_response" , sizeof ("__last_response" ));
26492649 }
2650- if (zend_hash_find (Z_OBJPROP_P (this_ptr ), "_soap_version" , sizeof ("_soap_version" ), (void * * ) & tmp ) == SUCCESS
2651- && Z_LVAL_PP (tmp ) == SOAP_1_2 ) {
2650+ if (zend_hash_find (Z_OBJPROP_P (this_ptr ), "_soap_version" , sizeof ("_soap_version" ), (void * * ) & tmp ) == SUCCESS &&
2651+ Z_TYPE_PP ( tmp ) == IS_LONG && Z_LVAL_PP (tmp ) == SOAP_1_2 ) {
26522652 soap_version = SOAP_1_2 ;
26532653 } else {
26542654 soap_version = SOAP_1_1 ;
@@ -2745,7 +2745,7 @@ static void do_soap_call(zval* this_ptr,
27452745 zval * * uri ;
27462746 smart_str action = {0 };
27472747
2748- if (zend_hash_find (Z_OBJPROP_P (this_ptr ), "uri" , sizeof ("uri" ), (void * )& uri ) == FAILURE ) {
2748+ if (zend_hash_find (Z_OBJPROP_P (this_ptr ), "uri" , sizeof ("uri" ), (void * )& uri ) == FAILURE || Z_TYPE_PP ( uri ) != IS_STRING ) {
27492749 add_soap_fault (this_ptr , "Client" , "Error finding \"uri\" property" , NULL , NULL TSRMLS_CC );
27502750 } else if (location == NULL ) {
27512751 add_soap_fault (this_ptr , "Client" , "Error could not find \"location\" property" , NULL , NULL TSRMLS_CC );
@@ -3024,7 +3024,8 @@ PHP_METHOD(SoapClient, __getLastRequest)
30243024 return ;
30253025 }
30263026
3027- if (zend_hash_find (Z_OBJPROP_P (this_ptr ), "__last_request" , sizeof ("__last_request" ), (void * * )& tmp ) == SUCCESS ) {
3027+ if (zend_hash_find (Z_OBJPROP_P (this_ptr ), "__last_request" , sizeof ("__last_request" ), (void * * )& tmp ) == SUCCESS &&
3028+ Z_TYPE_PP (tmp ) == IS_STRING ) {
30283029 RETURN_STRINGL (Z_STRVAL_PP (tmp ), Z_STRLEN_PP (tmp ), 1 );
30293030 }
30303031 RETURN_NULL ();
@@ -3042,7 +3043,8 @@ PHP_METHOD(SoapClient, __getLastResponse)
30423043 return ;
30433044 }
30443045
3045- if (zend_hash_find (Z_OBJPROP_P (this_ptr ), "__last_response" , sizeof ("__last_response" ), (void * * )& tmp ) == SUCCESS ) {
3046+ if (zend_hash_find (Z_OBJPROP_P (this_ptr ), "__last_response" , sizeof ("__last_response" ), (void * * )& tmp ) == SUCCESS &&
3047+ Z_TYPE_PP (tmp ) == IS_STRING ) {
30463048 RETURN_STRINGL (Z_STRVAL_PP (tmp ), Z_STRLEN_PP (tmp ), 1 );
30473049 }
30483050 RETURN_NULL ();
@@ -3060,7 +3062,8 @@ PHP_METHOD(SoapClient, __getLastRequestHeaders)
30603062 return ;
30613063 }
30623064
3063- if (zend_hash_find (Z_OBJPROP_P (this_ptr ), "__last_request_headers" , sizeof ("__last_request_headers" ), (void * * )& tmp ) == SUCCESS ) {
3065+ if (zend_hash_find (Z_OBJPROP_P (this_ptr ), "__last_request_headers" , sizeof ("__last_request_headers" ), (void * * )& tmp ) == SUCCESS &&
3066+ Z_TYPE_PP (tmp ) == IS_STRING ) {
30643067 RETURN_STRINGL (Z_STRVAL_PP (tmp ), Z_STRLEN_PP (tmp ), 1 );
30653068 }
30663069 RETURN_NULL ();
@@ -3078,7 +3081,8 @@ PHP_METHOD(SoapClient, __getLastResponseHeaders)
30783081 return ;
30793082 }
30803083
3081- if (zend_hash_find (Z_OBJPROP_P (this_ptr ), "__last_response_headers" , sizeof ("__last_response_headers" ), (void * * )& tmp ) == SUCCESS ) {
3084+ if (zend_hash_find (Z_OBJPROP_P (this_ptr ), "__last_response_headers" , sizeof ("__last_response_headers" ), (void * * )& tmp ) == SUCCESS &&
3085+ Z_TYPE_PP (tmp ) == IS_STRING ) {
30823086 RETURN_STRINGL (Z_STRVAL_PP (tmp ), Z_STRLEN_PP (tmp ), 1 );
30833087 }
30843088 RETURN_NULL ();
@@ -3134,13 +3138,15 @@ PHP_METHOD(SoapClient, __setCookie)
31343138 }
31353139
31363140 if (val == NULL ) {
3137- if (zend_hash_find (Z_OBJPROP_P (this_ptr ), "_cookies" , sizeof ("_cookies" ), (void * * )& cookies ) == SUCCESS ) {
3141+ if (zend_hash_find (Z_OBJPROP_P (this_ptr ), "_cookies" , sizeof ("_cookies" ), (void * * )& cookies ) == SUCCESS &&
3142+ Z_TYPE_PP (cookies ) == IS_ARRAY ) {
31383143 zend_hash_del (Z_ARRVAL_PP (cookies ), name , name_len + 1 );
31393144 }
31403145 } else {
31413146 zval * zcookie ;
31423147
3143- if (zend_hash_find (Z_OBJPROP_P (this_ptr ), "_cookies" , sizeof ("_cookies" ), (void * * )& cookies ) == FAILURE ) {
3148+ if (zend_hash_find (Z_OBJPROP_P (this_ptr ), "_cookies" , sizeof ("_cookies" ), (void * * )& cookies ) == FAILURE ||
3149+ Z_TYPE_PP (cookies ) != IS_ARRAY ) {
31443150 zval * tmp_cookies ;
31453151
31463152 MAKE_STD_ZVAL (tmp_cookies );
@@ -3168,7 +3174,8 @@ PHP_METHOD(SoapClient, __getCookies)
31683174
31693175 array_init (return_value );
31703176
3171- if (zend_hash_find (Z_OBJPROP_P (this_ptr ), "_cookies" , sizeof ("_cookies" ), (void * * )& cookies ) != FAILURE ) {
3177+ if (zend_hash_find (Z_OBJPROP_P (this_ptr ), "_cookies" , sizeof ("_cookies" ), (void * * )& cookies ) != FAILURE &&
3178+ Z_TYPE_PP (cookies ) == IS_ARRAY ) {
31723179 zend_hash_copy (Z_ARRVAL_P (return_value ), Z_ARRVAL_P (* cookies ), (copy_ctor_func_t ) zval_add_ref , (void * )& tmp , sizeof (zval * ));
31733180 }
31743181}
@@ -3990,7 +3997,8 @@ static xmlDocPtr serialize_response_call(sdlFunctionPtr function, char *function
39903997 }
39913998
39923999 if (version == SOAP_1_1 ) {
3993- if (zend_hash_find (prop , "faultcode" , sizeof ("faultcode" ), (void * * )& tmp ) == SUCCESS ) {
4000+ if (zend_hash_find (prop , "faultcode" , sizeof ("faultcode" ), (void * * )& tmp ) == SUCCESS &&
4001+ Z_TYPE_PP (tmp ) == IS_STRING ) {
39944002 size_t new_len ;
39954003 xmlNodePtr node = xmlNewNode (NULL , BAD_CAST ("faultcode" ));
39964004 char * str = php_escape_html_entities ((unsigned char * )Z_STRVAL_PP (tmp ), Z_STRLEN_PP (tmp ), & new_len , 0 , 0 , NULL TSRMLS_CC );
@@ -4015,7 +4023,8 @@ static xmlDocPtr serialize_response_call(sdlFunctionPtr function, char *function
40154023 }
40164024 detail_name = "detail" ;
40174025 } else {
4018- if (zend_hash_find (prop , "faultcode" , sizeof ("faultcode" ), (void * * )& tmp ) == SUCCESS ) {
4026+ if (zend_hash_find (prop , "faultcode" , sizeof ("faultcode" ), (void * * )& tmp ) == SUCCESS &&
4027+ Z_TYPE_PP (tmp ) == IS_STRING ) {
40194028 size_t new_len ;
40204029 xmlNodePtr node = xmlNewChild (param , ns , BAD_CAST ("Code" ), NULL );
40214030 char * str = php_escape_html_entities ((unsigned char * )Z_STRVAL_PP (tmp ), Z_STRLEN_PP (tmp ), & new_len , 0 , 0 , NULL TSRMLS_CC );
@@ -4255,7 +4264,8 @@ static xmlDocPtr serialize_function_call(zval *this_ptr, sdlFunctionPtr function
42554264 }
42564265 }
42574266 } else {
4258- if (zend_hash_find (Z_OBJPROP_P (this_ptr ), "style" , sizeof ("style" ), (void * * )& zstyle ) == SUCCESS ) {
4267+ if (zend_hash_find (Z_OBJPROP_P (this_ptr ), "style" , sizeof ("style" ), (void * * )& zstyle ) == SUCCESS &&
4268+ Z_TYPE_PP (zstyle ) == IS_LONG ) {
42594269 style = Z_LVAL_PP (zstyle );
42604270 } else {
42614271 style = SOAP_RPC ;
@@ -4278,7 +4288,7 @@ static xmlDocPtr serialize_function_call(zval *this_ptr, sdlFunctionPtr function
42784288 }
42794289
42804290 if (zend_hash_find (Z_OBJPROP_P (this_ptr ), "use" , sizeof ("use" ), (void * * )& zuse ) == SUCCESS &&
4281- Z_LVAL_PP (zuse ) == SOAP_LITERAL ) {
4291+ Z_TYPE_PP ( zuse ) == IS_LONG && Z_LVAL_PP (zuse ) == SOAP_LITERAL ) {
42824292 use = SOAP_LITERAL ;
42834293 } else {
42844294 use = SOAP_ENCODED ;
@@ -4408,6 +4418,7 @@ static xmlNodePtr serialize_parameter(sdlParamPtr param, zval *param_val, int in
44084418 zval * * param_data ;
44094419
44104420 if (zend_hash_find (Z_OBJPROP_P (param_val ), "param_name" , sizeof ("param_name" ), (void * * )& param_name ) == SUCCESS &&
4421+ Z_TYPE_PP (param_name ) == IS_STRING &&
44114422 zend_hash_find (Z_OBJPROP_P (param_val ), "param_data" , sizeof ("param_data" ), (void * * )& param_data ) == SUCCESS ) {
44124423 param_val = * param_data ;
44134424 name = Z_STRVAL_PP (param_name );
0 commit comments