@@ -264,6 +264,8 @@ static zend_result php_uri_parser_whatwg_scheme_write(void *uri, zval *value, zv
264264
265265 zval_string_or_null_to_lexbor_str (value , & str );
266266
267+ lxb_url_parser_clean (& lexbor_parser );
268+
267269 if (lxb_url_api_protocol_set (lexbor_uri , & lexbor_parser , str .data , str .length ) != LXB_STATUS_OK ) {
268270 throw_invalid_url_exception_during_write (errors , "scheme" );
269271
@@ -304,6 +306,8 @@ static zend_result php_uri_parser_whatwg_username_write(void *uri, zval *value,
304306
305307 zval_string_or_null_to_lexbor_str (value , & str );
306308
309+ lxb_url_parser_clean (& lexbor_parser );
310+
307311 if (lxb_url_api_username_set (lexbor_uri , str .data , str .length ) != LXB_STATUS_OK ) {
308312 throw_invalid_url_exception_during_write (errors , "username" );
309313
@@ -333,6 +337,8 @@ static zend_result php_uri_parser_whatwg_password_write(void *uri, zval *value,
333337
334338 zval_string_or_null_to_lexbor_str (value , & str );
335339
340+ lxb_url_parser_clean (& lexbor_parser );
341+
336342 if (lxb_url_api_password_set (lexbor_uri , str .data , str .length ) != LXB_STATUS_OK ) {
337343 throw_invalid_url_exception_during_write (errors , "password" );
338344
@@ -418,6 +424,8 @@ static zend_result php_uri_parser_whatwg_host_write(void *uri, zval *value, zval
418424
419425 zval_string_or_null_to_lexbor_str (value , & str );
420426
427+ lxb_url_parser_clean (& lexbor_parser );
428+
421429 if (lxb_url_api_hostname_set (lexbor_uri , & lexbor_parser , str .data , str .length ) != LXB_STATUS_OK ) {
422430 throw_invalid_url_exception_during_write (errors , "host" );
423431
@@ -447,6 +455,8 @@ static zend_result php_uri_parser_whatwg_port_write(void *uri, zval *value, zval
447455
448456 zval_long_or_null_to_lexbor_str (value , & str );
449457
458+ lxb_url_parser_clean (& lexbor_parser );
459+
450460 if (lxb_url_api_port_set (lexbor_uri , & lexbor_parser , str .data , str .length ) != LXB_STATUS_OK ) {
451461 throw_invalid_url_exception_during_write (errors , "port" );
452462
@@ -476,6 +486,8 @@ static zend_result php_uri_parser_whatwg_path_write(void *uri, zval *value, zval
476486
477487 zval_string_or_null_to_lexbor_str (value , & str );
478488
489+ lxb_url_parser_clean (& lexbor_parser );
490+
479491 if (lxb_url_api_pathname_set (lexbor_uri , & lexbor_parser , str .data , str .length ) != LXB_STATUS_OK ) {
480492 throw_invalid_url_exception_during_write (errors , "path" );
481493
@@ -505,6 +517,8 @@ static zend_result php_uri_parser_whatwg_query_write(void *uri, zval *value, zva
505517
506518 zval_string_or_null_to_lexbor_str (value , & str );
507519
520+ lxb_url_parser_clean (& lexbor_parser );
521+
508522 if (lxb_url_api_search_set (lexbor_uri , & lexbor_parser , str .data , str .length ) != LXB_STATUS_OK ) {
509523 throw_invalid_url_exception_during_write (errors , "query string" );
510524
@@ -534,6 +548,8 @@ static zend_result php_uri_parser_whatwg_fragment_write(void *uri, zval *value,
534548
535549 zval_string_or_null_to_lexbor_str (value , & str );
536550
551+ lxb_url_parser_clean (& lexbor_parser );
552+
537553 if (lxb_url_api_hash_set (lexbor_uri , & lexbor_parser , str .data , str .length ) != LXB_STATUS_OK ) {
538554 throw_invalid_url_exception_during_write (errors , "fragment" );
539555
0 commit comments