@@ -2554,7 +2554,7 @@ static int do_request(zval *this_ptr, xmlDoc *request, char *location, char *act
25542554 }
25552555
25562556 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 ) {
25582558 add_property_stringl (this_ptr , "__last_request" , buf , buf_size , 1 );
25592559 }
25602560
@@ -2594,7 +2594,7 @@ static int do_request(zval *this_ptr, xmlDoc *request, char *location, char *act
25942594 }
25952595 ret = FALSE;
25962596 } 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 ) {
25982598 add_property_stringl (this_ptr , "__last_response" , Z_STRVAL_P (response ), Z_STRLEN_P (response ), 1 );
25992599 }
26002600 xmlFree (buf );
@@ -2633,13 +2633,13 @@ static void do_soap_call(zval* this_ptr,
26332633
26342634 SOAP_CLIENT_BEGIN_CODE ();
26352635
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 ) {
26382638 zend_hash_del (Z_OBJPROP_P (this_ptr ), "__last_request" , sizeof ("__last_request" ));
26392639 zend_hash_del (Z_OBJPROP_P (this_ptr ), "__last_response" , sizeof ("__last_response" ));
26402640 }
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 ) {
26432643 soap_version = SOAP_1_2 ;
26442644 } else {
26452645 soap_version = SOAP_1_1 ;
@@ -2735,7 +2735,7 @@ static void do_soap_call(zval* this_ptr,
27352735 zval * * uri ;
27362736 smart_str action = {0 };
27372737
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 ) {
27392739 add_soap_fault (this_ptr , "Client" , "Error finding \"uri\" property" , NULL , NULL TSRMLS_CC );
27402740 } else if (location == NULL ) {
27412741 add_soap_fault (this_ptr , "Client" , "Error could not find \"location\" property" , NULL , NULL TSRMLS_CC );
@@ -3006,7 +3006,8 @@ PHP_METHOD(SoapClient, __getLastRequest)
30063006 return ;
30073007 }
30083008
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 ) {
30103011 RETURN_STRINGL (Z_STRVAL_PP (tmp ), Z_STRLEN_PP (tmp ), 1 );
30113012 }
30123013 RETURN_NULL ();
@@ -3024,7 +3025,8 @@ PHP_METHOD(SoapClient, __getLastResponse)
30243025 return ;
30253026 }
30263027
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 ) {
30283030 RETURN_STRINGL (Z_STRVAL_PP (tmp ), Z_STRLEN_PP (tmp ), 1 );
30293031 }
30303032 RETURN_NULL ();
@@ -3042,7 +3044,8 @@ PHP_METHOD(SoapClient, __getLastRequestHeaders)
30423044 return ;
30433045 }
30443046
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 ) {
30463049 RETURN_STRINGL (Z_STRVAL_PP (tmp ), Z_STRLEN_PP (tmp ), 1 );
30473050 }
30483051 RETURN_NULL ();
@@ -3060,7 +3063,8 @@ PHP_METHOD(SoapClient, __getLastResponseHeaders)
30603063 return ;
30613064 }
30623065
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 ) {
30643068 RETURN_STRINGL (Z_STRVAL_PP (tmp ), Z_STRLEN_PP (tmp ), 1 );
30653069 }
30663070 RETURN_NULL ();
@@ -3116,13 +3120,15 @@ PHP_METHOD(SoapClient, __setCookie)
31163120 }
31173121
31183122 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 ) {
31203125 zend_hash_del (Z_ARRVAL_PP (cookies ), name , name_len + 1 );
31213126 }
31223127 } else {
31233128 zval * zcookie ;
31243129
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 ) {
31263132 zval * tmp_cookies ;
31273133
31283134 MAKE_STD_ZVAL (tmp_cookies );
@@ -3150,7 +3156,8 @@ PHP_METHOD(SoapClient, __getCookies)
31503156
31513157 array_init (return_value );
31523158
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 ) {
31543161 zend_hash_copy (Z_ARRVAL_P (return_value ), Z_ARRVAL_P (* cookies ), (copy_ctor_func_t ) zval_add_ref , (void * )& tmp , sizeof (zval * ));
31553162 }
31563163}
@@ -4237,7 +4244,8 @@ static xmlDocPtr serialize_function_call(zval *this_ptr, sdlFunctionPtr function
42374244 }
42384245 }
42394246 } 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 ) {
42414249 style = Z_LVAL_PP (zstyle );
42424250 } else {
42434251 style = SOAP_RPC ;
@@ -4260,7 +4268,7 @@ static xmlDocPtr serialize_function_call(zval *this_ptr, sdlFunctionPtr function
42604268 }
42614269
42624270 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 ) {
42644272 use = SOAP_LITERAL ;
42654273 } else {
42664274 use = SOAP_ENCODED ;
@@ -4390,6 +4398,7 @@ static xmlNodePtr serialize_parameter(sdlParamPtr param, zval *param_val, int in
43904398 zval * * param_data ;
43914399
43924400 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 &&
43934402 zend_hash_find (Z_OBJPROP_P (param_val ), "param_data" , sizeof ("param_data" ), (void * * )& param_data ) == SUCCESS ) {
43944403 param_val = * param_data ;
43954404 name = Z_STRVAL_PP (param_name );
0 commit comments