@@ -870,28 +870,37 @@ bool make_http_soap_request(
870
870
bool first_cookie = true;
871
871
smart_str_append_const (& soap_headers , "Cookie: " );
872
872
ZEND_HASH_MAP_FOREACH_STR_KEY_VAL (Z_ARRVAL_P (cookies ), key , data ) {
873
- if (key && Z_TYPE_P (data ) == IS_ARRAY ) {
874
- zval * value ;
875
-
876
- if ((value = zend_hash_index_find (Z_ARRVAL_P (data ), 0 )) != NULL &&
877
- Z_TYPE_P (value ) == IS_STRING ) {
878
- zval * tmp ;
879
- if (((tmp = zend_hash_index_find (Z_ARRVAL_P (data ), 1 )) == NULL ||
880
- Z_TYPE_P (tmp ) != IS_STRING ||
881
- strncmp (phpurl -> path ?ZSTR_VAL (phpurl -> path ):"/" ,Z_STRVAL_P (tmp ),Z_STRLEN_P (tmp )) == 0 ) &&
882
- ((tmp = zend_hash_index_find (Z_ARRVAL_P (data ), 2 )) == NULL ||
883
- Z_TYPE_P (tmp ) != IS_STRING ||
884
- in_domain (phpurl -> host , Z_STR_P (tmp ))) &&
885
- (use_ssl || (tmp = zend_hash_index_find (Z_ARRVAL_P (data ), 3 )) == NULL )) {
886
- if (!first_cookie ) {
887
- smart_str_append_const (& soap_headers , "; " );
888
- }
889
- first_cookie = false;
890
- smart_str_append (& soap_headers , key );
891
- smart_str_appendc (& soap_headers , '=' );
892
- smart_str_append (& soap_headers , Z_STR_P (value ));
893
- }
873
+ if (key == NULL || Z_TYPE_P (data ) != IS_ARRAY ) {
874
+ continue ;
875
+ }
876
+
877
+ zval * value = zend_hash_index_find (Z_ARRVAL_P (data ), 0 );
878
+ if (value == NULL || Z_TYPE_P (value ) != IS_STRING ) {
879
+ continue ;
880
+ }
881
+
882
+ zval * tmp ;
883
+ if (
884
+ (
885
+ (tmp = zend_hash_index_find (Z_ARRVAL_P (data ), 1 )) == NULL
886
+ || Z_TYPE_P (tmp ) != IS_STRING
887
+ || strncmp (phpurl -> path ?ZSTR_VAL (phpurl -> path ):"/" ,Z_STRVAL_P (tmp ),Z_STRLEN_P (tmp )) == 0
888
+ ) && (
889
+ (tmp = zend_hash_index_find (Z_ARRVAL_P (data ), 2 )) == NULL
890
+ || Z_TYPE_P (tmp ) != IS_STRING
891
+ || in_domain (phpurl -> host , Z_STR_P (tmp ))
892
+ ) && (
893
+ use_ssl
894
+ || (tmp = zend_hash_index_find (Z_ARRVAL_P (data ), 3 )) == NULL
895
+ )
896
+ ) {
897
+ if (!first_cookie ) {
898
+ smart_str_append_const (& soap_headers , "; " );
894
899
}
900
+ first_cookie = false;
901
+ smart_str_append (& soap_headers , key );
902
+ smart_str_appendc (& soap_headers , '=' );
903
+ smart_str_append (& soap_headers , Z_STR_P (value ));
895
904
}
896
905
} ZEND_HASH_FOREACH_END ();
897
906
smart_str_append_const (& soap_headers , "\r\n" );
0 commit comments