@@ -53,29 +53,29 @@ bool proxy_authentication(const zval* this_ptr, smart_str* soap_headers)
53
53
}
54
54
55
55
/* HTTP Authentication */
56
- int basic_authentication (zval * this_ptr , smart_str * soap_headers )
56
+ bool basic_authentication (const zval * this_ptr , smart_str * soap_headers )
57
57
{
58
- zval * login = Z_CLIENT_LOGIN_P (this_ptr );
59
- zval * use_digest = Z_CLIENT_USE_DIGEST_P (this_ptr );
58
+ const zval * login = Z_CLIENT_LOGIN_P (this_ptr );
59
+ const zval * use_digest = Z_CLIENT_USE_DIGEST_P (this_ptr );
60
60
if (Z_TYPE_P (login ) == IS_STRING && Z_TYPE_P (use_digest ) != IS_TRUE ) {
61
61
smart_str auth = {0 };
62
62
smart_str_append (& auth , Z_STR_P (login ));
63
63
smart_str_appendc (& auth , ':' );
64
64
65
- zval * password = Z_CLIENT_PASSWORD_P (this_ptr );
65
+ const zval * password = Z_CLIENT_PASSWORD_P (this_ptr );
66
66
if (Z_TYPE_P (password ) == IS_STRING ) {
67
67
smart_str_append (& auth , Z_STR_P (password ));
68
68
}
69
69
smart_str_0 (& auth );
70
- zend_string * buf = php_base64_encode (( unsigned char * ) ZSTR_VAL ( auth .s ), ZSTR_LEN ( auth . s ) );
70
+ zend_string * buf = php_base64_encode_str ( auth .s );
71
71
smart_str_append_const (soap_headers , "Authorization: Basic " );
72
72
smart_str_append (soap_headers , buf );
73
73
smart_str_append_const (soap_headers , "\r\n" );
74
- zend_string_release_ex (buf , 0 );
74
+ zend_string_release_ex (buf , false );
75
75
smart_str_free (& auth );
76
- return 1 ;
76
+ return true ;
77
77
}
78
- return 0 ;
78
+ return false ;
79
79
}
80
80
81
81
static void http_context_add_header (const char * s ,
0 commit comments