@@ -308,18 +308,16 @@ static php_stream* http_connect(zval* this_ptr, php_url *phpurl, int use_ssl, ph
308
308
return stream ;
309
309
}
310
310
311
- static int in_domain (const char * host , const char * domain )
311
+ static bool in_domain (const zend_string * host , const zend_string * domain )
312
312
{
313
- if (domain [0 ] == '.' ) {
314
- int l1 = strlen (host );
315
- int l2 = strlen (domain );
316
- if (l1 > l2 ) {
317
- return strcmp (host + l1 - l2 ,domain ) == 0 ;
313
+ if (ZSTR_VAL (domain )[0 ] == '.' ) {
314
+ if (ZSTR_LEN (host ) > ZSTR_LEN (domain )) {
315
+ return strcmp (ZSTR_VAL (host )+ ZSTR_LEN (host )- ZSTR_LEN (domain ), ZSTR_VAL (domain )) == 0 ;
318
316
} else {
319
317
return 0 ;
320
318
}
321
319
} else {
322
- return strcmp (host ,domain ) == 0 ;
320
+ return zend_string_equals (host ,domain );
323
321
}
324
322
}
325
323
@@ -852,7 +850,7 @@ int make_http_soap_request(zval *this_ptr,
852
850
strncmp (phpurl -> path ?ZSTR_VAL (phpurl -> path ):"/" ,Z_STRVAL_P (tmp ),Z_STRLEN_P (tmp )) == 0 ) &&
853
851
((tmp = zend_hash_index_find (Z_ARRVAL_P (data ), 2 )) == NULL ||
854
852
Z_TYPE_P (tmp ) != IS_STRING ||
855
- in_domain (ZSTR_VAL ( phpurl -> host ), Z_STRVAL_P (tmp ))) &&
853
+ in_domain (phpurl -> host , Z_STR_P (tmp ))) &&
856
854
(use_ssl || (tmp = zend_hash_index_find (Z_ARRVAL_P (data ), 3 )) == NULL )) {
857
855
if (!first_cookie ) {
858
856
smart_str_appends (& soap_headers , "; " );
0 commit comments