@@ -2554,7 +2554,7 @@ static int do_request(zval *this_ptr, xmlDoc *request, char *location, char *act
2554
2554
}
2555
2555
2556
2556
if (zend_hash_find (Z_OBJPROP_P (this_ptr ), "trace" , sizeof ("trace" ), (void * * ) & trace ) == SUCCESS &&
2557
- Z_LVAL_PP (trace ) > 0 ) {
2557
+ ( Z_LVAL_PP (trace ) == IS_BOOL || Z_LVAL_PP ( trace ) == IS_LONG ) && Z_LVAL_PP ( trace ) != 0 ) {
2558
2558
add_property_stringl (this_ptr , "__last_request" , buf , buf_size , 1 );
2559
2559
}
2560
2560
@@ -2594,7 +2594,7 @@ static int do_request(zval *this_ptr, xmlDoc *request, char *location, char *act
2594
2594
}
2595
2595
ret = FALSE;
2596
2596
} else if (zend_hash_find (Z_OBJPROP_P (this_ptr ), "trace" , sizeof ("trace" ), (void * * ) & trace ) == SUCCESS &&
2597
- Z_LVAL_PP (trace ) > 0 ) {
2597
+ ( Z_LVAL_PP (trace ) == IS_BOOL || Z_LVAL_PP ( trace ) == IS_LONG ) && Z_LVAL_PP ( trace ) != 0 ) {
2598
2598
add_property_stringl (this_ptr , "__last_response" , Z_STRVAL_P (response ), Z_STRLEN_P (response ), 1 );
2599
2599
}
2600
2600
xmlFree (buf );
@@ -2633,13 +2633,13 @@ static void do_soap_call(zval* this_ptr,
2633
2633
2634
2634
SOAP_CLIENT_BEGIN_CODE ();
2635
2635
2636
- if (zend_hash_find (Z_OBJPROP_P (this_ptr ), "trace" , sizeof ("trace" ), (void * * ) & trace ) == SUCCESS
2637
- && Z_LVAL_PP (trace ) > 0 ) {
2636
+ if (zend_hash_find (Z_OBJPROP_P (this_ptr ), "trace" , sizeof ("trace" ), (void * * ) & trace ) == SUCCESS &&
2637
+ ( Z_LVAL_PP ( trace ) == IS_BOOL || Z_LVAL_PP ( trace ) == IS_LONG ) && Z_LVAL_PP (trace ) != 0 ) {
2638
2638
zend_hash_del (Z_OBJPROP_P (this_ptr ), "__last_request" , sizeof ("__last_request" ));
2639
2639
zend_hash_del (Z_OBJPROP_P (this_ptr ), "__last_response" , sizeof ("__last_response" ));
2640
2640
}
2641
- if (zend_hash_find (Z_OBJPROP_P (this_ptr ), "_soap_version" , sizeof ("_soap_version" ), (void * * ) & tmp ) == SUCCESS
2642
- && Z_LVAL_PP (tmp ) == SOAP_1_2 ) {
2641
+ if (zend_hash_find (Z_OBJPROP_P (this_ptr ), "_soap_version" , sizeof ("_soap_version" ), (void * * ) & tmp ) == SUCCESS &&
2642
+ Z_TYPE_PP ( tmp ) == IS_LONG && Z_LVAL_PP (tmp ) == SOAP_1_2 ) {
2643
2643
soap_version = SOAP_1_2 ;
2644
2644
} else {
2645
2645
soap_version = SOAP_1_1 ;
@@ -2735,7 +2735,7 @@ static void do_soap_call(zval* this_ptr,
2735
2735
zval * * uri ;
2736
2736
smart_str action = {0 };
2737
2737
2738
- if (zend_hash_find (Z_OBJPROP_P (this_ptr ), "uri" , sizeof ("uri" ), (void * )& uri ) == FAILURE ) {
2738
+ if (zend_hash_find (Z_OBJPROP_P (this_ptr ), "uri" , sizeof ("uri" ), (void * )& uri ) == FAILURE || Z_TYPE_PP ( uri ) != IS_STRING ) {
2739
2739
add_soap_fault (this_ptr , "Client" , "Error finding \"uri\" property" , NULL , NULL TSRMLS_CC );
2740
2740
} else if (location == NULL ) {
2741
2741
add_soap_fault (this_ptr , "Client" , "Error could not find \"location\" property" , NULL , NULL TSRMLS_CC );
@@ -3006,7 +3006,8 @@ PHP_METHOD(SoapClient, __getLastRequest)
3006
3006
return ;
3007
3007
}
3008
3008
3009
- if (zend_hash_find (Z_OBJPROP_P (this_ptr ), "__last_request" , sizeof ("__last_request" ), (void * * )& tmp ) == SUCCESS ) {
3009
+ if (zend_hash_find (Z_OBJPROP_P (this_ptr ), "__last_request" , sizeof ("__last_request" ), (void * * )& tmp ) == SUCCESS &&
3010
+ Z_TYPE_PP (tmp ) == IS_STRING ) {
3010
3011
RETURN_STRINGL (Z_STRVAL_PP (tmp ), Z_STRLEN_PP (tmp ), 1 );
3011
3012
}
3012
3013
RETURN_NULL ();
@@ -3024,7 +3025,8 @@ PHP_METHOD(SoapClient, __getLastResponse)
3024
3025
return ;
3025
3026
}
3026
3027
3027
- if (zend_hash_find (Z_OBJPROP_P (this_ptr ), "__last_response" , sizeof ("__last_response" ), (void * * )& tmp ) == SUCCESS ) {
3028
+ if (zend_hash_find (Z_OBJPROP_P (this_ptr ), "__last_response" , sizeof ("__last_response" ), (void * * )& tmp ) == SUCCESS &&
3029
+ Z_TYPE_PP (tmp ) == IS_STRING ) {
3028
3030
RETURN_STRINGL (Z_STRVAL_PP (tmp ), Z_STRLEN_PP (tmp ), 1 );
3029
3031
}
3030
3032
RETURN_NULL ();
@@ -3042,7 +3044,8 @@ PHP_METHOD(SoapClient, __getLastRequestHeaders)
3042
3044
return ;
3043
3045
}
3044
3046
3045
- if (zend_hash_find (Z_OBJPROP_P (this_ptr ), "__last_request_headers" , sizeof ("__last_request_headers" ), (void * * )& tmp ) == SUCCESS ) {
3047
+ if (zend_hash_find (Z_OBJPROP_P (this_ptr ), "__last_request_headers" , sizeof ("__last_request_headers" ), (void * * )& tmp ) == SUCCESS &&
3048
+ Z_TYPE_PP (tmp ) == IS_STRING ) {
3046
3049
RETURN_STRINGL (Z_STRVAL_PP (tmp ), Z_STRLEN_PP (tmp ), 1 );
3047
3050
}
3048
3051
RETURN_NULL ();
@@ -3060,7 +3063,8 @@ PHP_METHOD(SoapClient, __getLastResponseHeaders)
3060
3063
return ;
3061
3064
}
3062
3065
3063
- if (zend_hash_find (Z_OBJPROP_P (this_ptr ), "__last_response_headers" , sizeof ("__last_response_headers" ), (void * * )& tmp ) == SUCCESS ) {
3066
+ if (zend_hash_find (Z_OBJPROP_P (this_ptr ), "__last_response_headers" , sizeof ("__last_response_headers" ), (void * * )& tmp ) == SUCCESS &&
3067
+ Z_TYPE_PP (tmp ) == IS_STRING ) {
3064
3068
RETURN_STRINGL (Z_STRVAL_PP (tmp ), Z_STRLEN_PP (tmp ), 1 );
3065
3069
}
3066
3070
RETURN_NULL ();
@@ -3116,13 +3120,15 @@ PHP_METHOD(SoapClient, __setCookie)
3116
3120
}
3117
3121
3118
3122
if (val == NULL ) {
3119
- if (zend_hash_find (Z_OBJPROP_P (this_ptr ), "_cookies" , sizeof ("_cookies" ), (void * * )& cookies ) == SUCCESS ) {
3123
+ if (zend_hash_find (Z_OBJPROP_P (this_ptr ), "_cookies" , sizeof ("_cookies" ), (void * * )& cookies ) == SUCCESS &&
3124
+ Z_TYPE_PP (cookies ) == IS_ARRAY ) {
3120
3125
zend_hash_del (Z_ARRVAL_PP (cookies ), name , name_len + 1 );
3121
3126
}
3122
3127
} else {
3123
3128
zval * zcookie ;
3124
3129
3125
- if (zend_hash_find (Z_OBJPROP_P (this_ptr ), "_cookies" , sizeof ("_cookies" ), (void * * )& cookies ) == FAILURE ) {
3130
+ if (zend_hash_find (Z_OBJPROP_P (this_ptr ), "_cookies" , sizeof ("_cookies" ), (void * * )& cookies ) == FAILURE ||
3131
+ Z_TYPE_PP (cookies ) != IS_ARRAY ) {
3126
3132
zval * tmp_cookies ;
3127
3133
3128
3134
MAKE_STD_ZVAL (tmp_cookies );
@@ -3150,7 +3156,8 @@ PHP_METHOD(SoapClient, __getCookies)
3150
3156
3151
3157
array_init (return_value );
3152
3158
3153
- if (zend_hash_find (Z_OBJPROP_P (this_ptr ), "_cookies" , sizeof ("_cookies" ), (void * * )& cookies ) != FAILURE ) {
3159
+ if (zend_hash_find (Z_OBJPROP_P (this_ptr ), "_cookies" , sizeof ("_cookies" ), (void * * )& cookies ) != FAILURE &&
3160
+ Z_TYPE_PP (cookies ) == IS_ARRAY ) {
3154
3161
zend_hash_copy (Z_ARRVAL_P (return_value ), Z_ARRVAL_P (* cookies ), (copy_ctor_func_t ) zval_add_ref , (void * )& tmp , sizeof (zval * ));
3155
3162
}
3156
3163
}
@@ -4237,7 +4244,8 @@ static xmlDocPtr serialize_function_call(zval *this_ptr, sdlFunctionPtr function
4237
4244
}
4238
4245
}
4239
4246
} else {
4240
- if (zend_hash_find (Z_OBJPROP_P (this_ptr ), "style" , sizeof ("style" ), (void * * )& zstyle ) == SUCCESS ) {
4247
+ if (zend_hash_find (Z_OBJPROP_P (this_ptr ), "style" , sizeof ("style" ), (void * * )& zstyle ) == SUCCESS &&
4248
+ Z_TYPE_PP (zstyle ) == IS_LONG ) {
4241
4249
style = Z_LVAL_PP (zstyle );
4242
4250
} else {
4243
4251
style = SOAP_RPC ;
@@ -4260,7 +4268,7 @@ static xmlDocPtr serialize_function_call(zval *this_ptr, sdlFunctionPtr function
4260
4268
}
4261
4269
4262
4270
if (zend_hash_find (Z_OBJPROP_P (this_ptr ), "use" , sizeof ("use" ), (void * * )& zuse ) == SUCCESS &&
4263
- Z_LVAL_PP (zuse ) == SOAP_LITERAL ) {
4271
+ Z_TYPE_PP ( zuse ) == IS_LONG && Z_LVAL_PP (zuse ) == SOAP_LITERAL ) {
4264
4272
use = SOAP_LITERAL ;
4265
4273
} else {
4266
4274
use = SOAP_ENCODED ;
@@ -4390,6 +4398,7 @@ static xmlNodePtr serialize_parameter(sdlParamPtr param, zval *param_val, int in
4390
4398
zval * * param_data ;
4391
4399
4392
4400
if (zend_hash_find (Z_OBJPROP_P (param_val ), "param_name" , sizeof ("param_name" ), (void * * )& param_name ) == SUCCESS &&
4401
+ Z_TYPE_PP (param_name ) == IS_STRING &&
4393
4402
zend_hash_find (Z_OBJPROP_P (param_val ), "param_data" , sizeof ("param_data" ), (void * * )& param_data ) == SUCCESS ) {
4394
4403
param_val = * param_data ;
4395
4404
name = Z_STRVAL_PP (param_name );
0 commit comments