@@ -2563,7 +2563,7 @@ static int do_request(zval *this_ptr, xmlDoc *request, char *location, char *act
2563
2563
}
2564
2564
2565
2565
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 ) {
2567
2567
add_property_stringl (this_ptr , "__last_request" , buf , buf_size , 1 );
2568
2568
}
2569
2569
@@ -2598,7 +2598,7 @@ static int do_request(zval *this_ptr, xmlDoc *request, char *location, char *act
2598
2598
}
2599
2599
ret = FALSE;
2600
2600
} 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 ) {
2602
2602
add_property_stringl (this_ptr , "__last_response" , Z_STRVAL_P (response ), Z_STRLEN_P (response ), 1 );
2603
2603
}
2604
2604
zval_ptr_dtor (& params [4 ]);
@@ -2642,13 +2642,13 @@ static void do_soap_call(zval* this_ptr,
2642
2642
2643
2643
SOAP_CLIENT_BEGIN_CODE ();
2644
2644
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 ) {
2647
2647
zend_hash_del (Z_OBJPROP_P (this_ptr ), "__last_request" , sizeof ("__last_request" ));
2648
2648
zend_hash_del (Z_OBJPROP_P (this_ptr ), "__last_response" , sizeof ("__last_response" ));
2649
2649
}
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 ) {
2652
2652
soap_version = SOAP_1_2 ;
2653
2653
} else {
2654
2654
soap_version = SOAP_1_1 ;
@@ -2745,7 +2745,7 @@ static void do_soap_call(zval* this_ptr,
2745
2745
zval * * uri ;
2746
2746
smart_str action = {0 };
2747
2747
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 ) {
2749
2749
add_soap_fault (this_ptr , "Client" , "Error finding \"uri\" property" , NULL , NULL TSRMLS_CC );
2750
2750
} else if (location == NULL ) {
2751
2751
add_soap_fault (this_ptr , "Client" , "Error could not find \"location\" property" , NULL , NULL TSRMLS_CC );
@@ -3024,7 +3024,8 @@ PHP_METHOD(SoapClient, __getLastRequest)
3024
3024
return ;
3025
3025
}
3026
3026
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 ) {
3028
3029
RETURN_STRINGL (Z_STRVAL_PP (tmp ), Z_STRLEN_PP (tmp ), 1 );
3029
3030
}
3030
3031
RETURN_NULL ();
@@ -3042,7 +3043,8 @@ PHP_METHOD(SoapClient, __getLastResponse)
3042
3043
return ;
3043
3044
}
3044
3045
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 ) {
3046
3048
RETURN_STRINGL (Z_STRVAL_PP (tmp ), Z_STRLEN_PP (tmp ), 1 );
3047
3049
}
3048
3050
RETURN_NULL ();
@@ -3060,7 +3062,8 @@ PHP_METHOD(SoapClient, __getLastRequestHeaders)
3060
3062
return ;
3061
3063
}
3062
3064
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 ) {
3064
3067
RETURN_STRINGL (Z_STRVAL_PP (tmp ), Z_STRLEN_PP (tmp ), 1 );
3065
3068
}
3066
3069
RETURN_NULL ();
@@ -3078,7 +3081,8 @@ PHP_METHOD(SoapClient, __getLastResponseHeaders)
3078
3081
return ;
3079
3082
}
3080
3083
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 ) {
3082
3086
RETURN_STRINGL (Z_STRVAL_PP (tmp ), Z_STRLEN_PP (tmp ), 1 );
3083
3087
}
3084
3088
RETURN_NULL ();
@@ -3134,13 +3138,15 @@ PHP_METHOD(SoapClient, __setCookie)
3134
3138
}
3135
3139
3136
3140
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 ) {
3138
3143
zend_hash_del (Z_ARRVAL_PP (cookies ), name , name_len + 1 );
3139
3144
}
3140
3145
} else {
3141
3146
zval * zcookie ;
3142
3147
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 ) {
3144
3150
zval * tmp_cookies ;
3145
3151
3146
3152
MAKE_STD_ZVAL (tmp_cookies );
@@ -3168,7 +3174,8 @@ PHP_METHOD(SoapClient, __getCookies)
3168
3174
3169
3175
array_init (return_value );
3170
3176
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 ) {
3172
3179
zend_hash_copy (Z_ARRVAL_P (return_value ), Z_ARRVAL_P (* cookies ), (copy_ctor_func_t ) zval_add_ref , (void * )& tmp , sizeof (zval * ));
3173
3180
}
3174
3181
}
@@ -3990,7 +3997,8 @@ static xmlDocPtr serialize_response_call(sdlFunctionPtr function, char *function
3990
3997
}
3991
3998
3992
3999
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 ) {
3994
4002
size_t new_len ;
3995
4003
xmlNodePtr node = xmlNewNode (NULL , BAD_CAST ("faultcode" ));
3996
4004
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
4015
4023
}
4016
4024
detail_name = "detail" ;
4017
4025
} 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 ) {
4019
4028
size_t new_len ;
4020
4029
xmlNodePtr node = xmlNewChild (param , ns , BAD_CAST ("Code" ), NULL );
4021
4030
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
4255
4264
}
4256
4265
}
4257
4266
} 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 ) {
4259
4269
style = Z_LVAL_PP (zstyle );
4260
4270
} else {
4261
4271
style = SOAP_RPC ;
@@ -4278,7 +4288,7 @@ static xmlDocPtr serialize_function_call(zval *this_ptr, sdlFunctionPtr function
4278
4288
}
4279
4289
4280
4290
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 ) {
4282
4292
use = SOAP_LITERAL ;
4283
4293
} else {
4284
4294
use = SOAP_ENCODED ;
@@ -4408,6 +4418,7 @@ static xmlNodePtr serialize_parameter(sdlParamPtr param, zval *param_val, int in
4408
4418
zval * * param_data ;
4409
4419
4410
4420
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 &&
4411
4422
zend_hash_find (Z_OBJPROP_P (param_val ), "param_data" , sizeof ("param_data" ), (void * * )& param_data ) == SUCCESS ) {
4412
4423
param_val = * param_data ;
4413
4424
name = Z_STRVAL_PP (param_name );
0 commit comments