@@ -2564,7 +2564,7 @@ static int do_request(zval *this_ptr, xmlDoc *request, char *location, char *act
2564
2564
}
2565
2565
2566
2566
if (zend_hash_find (Z_OBJPROP_P (this_ptr ), "trace" , sizeof ("trace" ), (void * * ) & trace ) == SUCCESS &&
2567
- Z_TYPE_PP ( trace ) == IS_LONG && Z_LVAL_PP (trace ) > 0 ) {
2567
+ ( Z_LVAL_PP ( trace ) == IS_BOOL || Z_LVAL_PP ( trace ) == IS_LONG ) && Z_LVAL_PP (trace ) != 0 ) {
2568
2568
add_property_stringl (this_ptr , "__last_request" , buf , buf_size , 1 );
2569
2569
}
2570
2570
@@ -2599,7 +2599,7 @@ static int do_request(zval *this_ptr, xmlDoc *request, char *location, char *act
2599
2599
}
2600
2600
ret = FALSE;
2601
2601
} else if (zend_hash_find (Z_OBJPROP_P (this_ptr ), "trace" , sizeof ("trace" ), (void * * ) & trace ) == SUCCESS &&
2602
- Z_TYPE_PP ( trace ) == IS_LONG && Z_LVAL_PP (trace ) > 0 ) {
2602
+ ( Z_LVAL_PP ( trace ) == IS_BOOL || Z_LVAL_PP ( trace ) == IS_LONG ) && Z_LVAL_PP (trace ) != 0 ) {
2603
2603
add_property_stringl (this_ptr , "__last_response" , Z_STRVAL_P (response ), Z_STRLEN_P (response ), 1 );
2604
2604
}
2605
2605
zval_ptr_dtor (& params [4 ]);
@@ -2643,13 +2643,13 @@ static void do_soap_call(zval* this_ptr,
2643
2643
2644
2644
SOAP_CLIENT_BEGIN_CODE ();
2645
2645
2646
- if (zend_hash_find (Z_OBJPROP_P (this_ptr ), "trace" , sizeof ("trace" ), (void * * ) & trace ) == SUCCESS
2647
- && Z_LVAL_PP (trace ) > 0 ) {
2646
+ if (zend_hash_find (Z_OBJPROP_P (this_ptr ), "trace" , sizeof ("trace" ), (void * * ) & trace ) == SUCCESS &&
2647
+ ( Z_LVAL_PP ( trace ) == IS_BOOL || Z_LVAL_PP ( trace ) == IS_LONG ) && Z_LVAL_PP (trace ) != 0 ) {
2648
2648
zend_hash_del (Z_OBJPROP_P (this_ptr ), "__last_request" , sizeof ("__last_request" ));
2649
2649
zend_hash_del (Z_OBJPROP_P (this_ptr ), "__last_response" , sizeof ("__last_response" ));
2650
2650
}
2651
- if (zend_hash_find (Z_OBJPROP_P (this_ptr ), "_soap_version" , sizeof ("_soap_version" ), (void * * ) & tmp ) == SUCCESS
2652
- && Z_LVAL_PP (tmp ) == SOAP_1_2 ) {
2651
+ if (zend_hash_find (Z_OBJPROP_P (this_ptr ), "_soap_version" , sizeof ("_soap_version" ), (void * * ) & tmp ) == SUCCESS &&
2652
+ Z_TYPE_PP ( tmp ) == IS_LONG && Z_LVAL_PP (tmp ) == SOAP_1_2 ) {
2653
2653
soap_version = SOAP_1_2 ;
2654
2654
} else {
2655
2655
soap_version = SOAP_1_1 ;
@@ -2746,7 +2746,7 @@ static void do_soap_call(zval* this_ptr,
2746
2746
zval * * uri ;
2747
2747
smart_str action = {0 };
2748
2748
2749
- if (zend_hash_find (Z_OBJPROP_P (this_ptr ), "uri" , sizeof ("uri" ), (void * )& uri ) == FAILURE ) {
2749
+ if (zend_hash_find (Z_OBJPROP_P (this_ptr ), "uri" , sizeof ("uri" ), (void * )& uri ) == FAILURE || Z_TYPE_PP ( uri ) != IS_STRING ) {
2750
2750
add_soap_fault (this_ptr , "Client" , "Error finding \"uri\" property" , NULL , NULL TSRMLS_CC );
2751
2751
} else if (location == NULL ) {
2752
2752
add_soap_fault (this_ptr , "Client" , "Error could not find \"location\" property" , NULL , NULL TSRMLS_CC );
@@ -3025,7 +3025,8 @@ PHP_METHOD(SoapClient, __getLastRequest)
3025
3025
return ;
3026
3026
}
3027
3027
3028
- if (zend_hash_find (Z_OBJPROP_P (this_ptr ), "__last_request" , sizeof ("__last_request" ), (void * * )& tmp ) == SUCCESS ) {
3028
+ if (zend_hash_find (Z_OBJPROP_P (this_ptr ), "__last_request" , sizeof ("__last_request" ), (void * * )& tmp ) == SUCCESS &&
3029
+ Z_TYPE_PP (tmp ) == IS_STRING ) {
3029
3030
RETURN_STRINGL (Z_STRVAL_PP (tmp ), Z_STRLEN_PP (tmp ), 1 );
3030
3031
}
3031
3032
RETURN_NULL ();
@@ -3043,7 +3044,8 @@ PHP_METHOD(SoapClient, __getLastResponse)
3043
3044
return ;
3044
3045
}
3045
3046
3046
- if (zend_hash_find (Z_OBJPROP_P (this_ptr ), "__last_response" , sizeof ("__last_response" ), (void * * )& tmp ) == SUCCESS ) {
3047
+ if (zend_hash_find (Z_OBJPROP_P (this_ptr ), "__last_response" , sizeof ("__last_response" ), (void * * )& tmp ) == SUCCESS &&
3048
+ Z_TYPE_PP (tmp ) == IS_STRING ) {
3047
3049
RETURN_STRINGL (Z_STRVAL_PP (tmp ), Z_STRLEN_PP (tmp ), 1 );
3048
3050
}
3049
3051
RETURN_NULL ();
@@ -3061,7 +3063,8 @@ PHP_METHOD(SoapClient, __getLastRequestHeaders)
3061
3063
return ;
3062
3064
}
3063
3065
3064
- if (zend_hash_find (Z_OBJPROP_P (this_ptr ), "__last_request_headers" , sizeof ("__last_request_headers" ), (void * * )& tmp ) == SUCCESS ) {
3066
+ if (zend_hash_find (Z_OBJPROP_P (this_ptr ), "__last_request_headers" , sizeof ("__last_request_headers" ), (void * * )& tmp ) == SUCCESS &&
3067
+ Z_TYPE_PP (tmp ) == IS_STRING ) {
3065
3068
RETURN_STRINGL (Z_STRVAL_PP (tmp ), Z_STRLEN_PP (tmp ), 1 );
3066
3069
}
3067
3070
RETURN_NULL ();
@@ -3079,7 +3082,8 @@ PHP_METHOD(SoapClient, __getLastResponseHeaders)
3079
3082
return ;
3080
3083
}
3081
3084
3082
- if (zend_hash_find (Z_OBJPROP_P (this_ptr ), "__last_response_headers" , sizeof ("__last_response_headers" ), (void * * )& tmp ) == SUCCESS ) {
3085
+ if (zend_hash_find (Z_OBJPROP_P (this_ptr ), "__last_response_headers" , sizeof ("__last_response_headers" ), (void * * )& tmp ) == SUCCESS &&
3086
+ Z_TYPE_PP (tmp ) == IS_STRING ) {
3083
3087
RETURN_STRINGL (Z_STRVAL_PP (tmp ), Z_STRLEN_PP (tmp ), 1 );
3084
3088
}
3085
3089
RETURN_NULL ();
@@ -3135,13 +3139,15 @@ PHP_METHOD(SoapClient, __setCookie)
3135
3139
}
3136
3140
3137
3141
if (val == NULL ) {
3138
- if (zend_hash_find (Z_OBJPROP_P (this_ptr ), "_cookies" , sizeof ("_cookies" ), (void * * )& cookies ) == SUCCESS ) {
3142
+ if (zend_hash_find (Z_OBJPROP_P (this_ptr ), "_cookies" , sizeof ("_cookies" ), (void * * )& cookies ) == SUCCESS &&
3143
+ Z_TYPE_PP (cookies ) == IS_ARRAY ) {
3139
3144
zend_hash_del (Z_ARRVAL_PP (cookies ), name , name_len + 1 );
3140
3145
}
3141
3146
} else {
3142
3147
zval * zcookie ;
3143
3148
3144
- if (zend_hash_find (Z_OBJPROP_P (this_ptr ), "_cookies" , sizeof ("_cookies" ), (void * * )& cookies ) == FAILURE ) {
3149
+ if (zend_hash_find (Z_OBJPROP_P (this_ptr ), "_cookies" , sizeof ("_cookies" ), (void * * )& cookies ) == FAILURE ||
3150
+ Z_TYPE_PP (cookies ) != IS_ARRAY ) {
3145
3151
zval * tmp_cookies ;
3146
3152
3147
3153
MAKE_STD_ZVAL (tmp_cookies );
@@ -3169,7 +3175,8 @@ PHP_METHOD(SoapClient, __getCookies)
3169
3175
3170
3176
array_init (return_value );
3171
3177
3172
- if (zend_hash_find (Z_OBJPROP_P (this_ptr ), "_cookies" , sizeof ("_cookies" ), (void * * )& cookies ) != FAILURE ) {
3178
+ if (zend_hash_find (Z_OBJPROP_P (this_ptr ), "_cookies" , sizeof ("_cookies" ), (void * * )& cookies ) != FAILURE &&
3179
+ Z_TYPE_PP (cookies ) == IS_ARRAY ) {
3173
3180
zend_hash_copy (Z_ARRVAL_P (return_value ), Z_ARRVAL_P (* cookies ), (copy_ctor_func_t ) zval_add_ref , (void * )& tmp , sizeof (zval * ));
3174
3181
}
3175
3182
}
@@ -3991,7 +3998,8 @@ static xmlDocPtr serialize_response_call(sdlFunctionPtr function, char *function
3991
3998
}
3992
3999
3993
4000
if (version == SOAP_1_1 ) {
3994
- if (zend_hash_find (prop , "faultcode" , sizeof ("faultcode" ), (void * * )& tmp ) == SUCCESS ) {
4001
+ if (zend_hash_find (prop , "faultcode" , sizeof ("faultcode" ), (void * * )& tmp ) == SUCCESS &&
4002
+ Z_TYPE_PP (tmp ) == IS_STRING ) {
3995
4003
size_t new_len ;
3996
4004
xmlNodePtr node = xmlNewNode (NULL , BAD_CAST ("faultcode" ));
3997
4005
char * str = php_escape_html_entities ((unsigned char * )Z_STRVAL_PP (tmp ), Z_STRLEN_PP (tmp ), & new_len , 0 , 0 , NULL TSRMLS_CC );
@@ -4016,7 +4024,8 @@ static xmlDocPtr serialize_response_call(sdlFunctionPtr function, char *function
4016
4024
}
4017
4025
detail_name = "detail" ;
4018
4026
} else {
4019
- if (zend_hash_find (prop , "faultcode" , sizeof ("faultcode" ), (void * * )& tmp ) == SUCCESS ) {
4027
+ if (zend_hash_find (prop , "faultcode" , sizeof ("faultcode" ), (void * * )& tmp ) == SUCCESS &&
4028
+ Z_TYPE_PP (tmp ) == IS_STRING ) {
4020
4029
size_t new_len ;
4021
4030
xmlNodePtr node = xmlNewChild (param , ns , BAD_CAST ("Code" ), NULL );
4022
4031
char * str = php_escape_html_entities ((unsigned char * )Z_STRVAL_PP (tmp ), Z_STRLEN_PP (tmp ), & new_len , 0 , 0 , NULL TSRMLS_CC );
@@ -4256,7 +4265,8 @@ static xmlDocPtr serialize_function_call(zval *this_ptr, sdlFunctionPtr function
4256
4265
}
4257
4266
}
4258
4267
} else {
4259
- if (zend_hash_find (Z_OBJPROP_P (this_ptr ), "style" , sizeof ("style" ), (void * * )& zstyle ) == SUCCESS ) {
4268
+ if (zend_hash_find (Z_OBJPROP_P (this_ptr ), "style" , sizeof ("style" ), (void * * )& zstyle ) == SUCCESS &&
4269
+ Z_TYPE_PP (zstyle ) == IS_LONG ) {
4260
4270
style = Z_LVAL_PP (zstyle );
4261
4271
} else {
4262
4272
style = SOAP_RPC ;
@@ -4279,7 +4289,7 @@ static xmlDocPtr serialize_function_call(zval *this_ptr, sdlFunctionPtr function
4279
4289
}
4280
4290
4281
4291
if (zend_hash_find (Z_OBJPROP_P (this_ptr ), "use" , sizeof ("use" ), (void * * )& zuse ) == SUCCESS &&
4282
- Z_LVAL_PP (zuse ) == SOAP_LITERAL ) {
4292
+ Z_TYPE_PP ( zuse ) == IS_LONG && Z_LVAL_PP (zuse ) == SOAP_LITERAL ) {
4283
4293
use = SOAP_LITERAL ;
4284
4294
} else {
4285
4295
use = SOAP_ENCODED ;
@@ -4409,6 +4419,7 @@ static xmlNodePtr serialize_parameter(sdlParamPtr param, zval *param_val, int in
4409
4419
zval * * param_data ;
4410
4420
4411
4421
if (zend_hash_find (Z_OBJPROP_P (param_val ), "param_name" , sizeof ("param_name" ), (void * * )& param_name ) == SUCCESS &&
4422
+ Z_TYPE_PP (param_name ) == IS_STRING &&
4412
4423
zend_hash_find (Z_OBJPROP_P (param_val ), "param_data" , sizeof ("param_data" ), (void * * )& param_data ) == SUCCESS ) {
4413
4424
param_val = * param_data ;
4414
4425
name = Z_STRVAL_PP (param_name );
0 commit comments