@@ -265,6 +265,8 @@ static zend_result php_uri_parser_whatwg_scheme_write(void *uri, zval *value, zv
265265
266266 zval_string_or_null_to_lexbor_str (value , & str );
267267
268+ lxb_url_parser_clean (& lexbor_parser );
269+
268270 if (lxb_url_api_protocol_set (lexbor_uri , & lexbor_parser , str .data , str .length ) != LXB_STATUS_OK ) {
269271 throw_invalid_url_exception_during_write (errors , "scheme" );
270272
@@ -300,6 +302,8 @@ static zend_result php_uri_parser_whatwg_username_write(void *uri, zval *value,
300302
301303 zval_string_or_null_to_lexbor_str (value , & str );
302304
305+ lxb_url_parser_clean (& lexbor_parser );
306+
303307 if (lxb_url_api_username_set (lexbor_uri , str .data , str .length ) != LXB_STATUS_OK ) {
304308 throw_invalid_url_exception_during_write (errors , "username" );
305309
@@ -329,6 +333,8 @@ static zend_result php_uri_parser_whatwg_password_write(void *uri, zval *value,
329333
330334 zval_string_or_null_to_lexbor_str (value , & str );
331335
336+ lxb_url_parser_clean (& lexbor_parser );
337+
332338 if (lxb_url_api_password_set (lexbor_uri , str .data , str .length ) != LXB_STATUS_OK ) {
333339 throw_invalid_url_exception_during_write (errors , "password" );
334340
@@ -389,6 +395,8 @@ static zend_result php_uri_parser_whatwg_host_write(void *uri, zval *value, zval
389395
390396 zval_string_or_null_to_lexbor_str (value , & str );
391397
398+ lxb_url_parser_clean (& lexbor_parser );
399+
392400 if (lxb_url_api_hostname_set (lexbor_uri , & lexbor_parser , str .data , str .length ) != LXB_STATUS_OK ) {
393401 throw_invalid_url_exception_during_write (errors , "host" );
394402
@@ -418,6 +426,8 @@ static zend_result php_uri_parser_whatwg_port_write(void *uri, zval *value, zval
418426
419427 zval_long_or_null_to_lexbor_str (value , & str );
420428
429+ lxb_url_parser_clean (& lexbor_parser );
430+
421431 if (lxb_url_api_port_set (lexbor_uri , & lexbor_parser , str .data , str .length ) != LXB_STATUS_OK ) {
422432 throw_invalid_url_exception_during_write (errors , "port" );
423433
@@ -447,6 +457,8 @@ static zend_result php_uri_parser_whatwg_path_write(void *uri, zval *value, zval
447457
448458 zval_string_or_null_to_lexbor_str (value , & str );
449459
460+ lxb_url_parser_clean (& lexbor_parser );
461+
450462 if (lxb_url_api_pathname_set (lexbor_uri , & lexbor_parser , str .data , str .length ) != LXB_STATUS_OK ) {
451463 throw_invalid_url_exception_during_write (errors , "path" );
452464
@@ -476,6 +488,8 @@ static zend_result php_uri_parser_whatwg_query_write(void *uri, zval *value, zva
476488
477489 zval_string_or_null_to_lexbor_str (value , & str );
478490
491+ lxb_url_parser_clean (& lexbor_parser );
492+
479493 if (lxb_url_api_search_set (lexbor_uri , & lexbor_parser , str .data , str .length ) != LXB_STATUS_OK ) {
480494 throw_invalid_url_exception_during_write (errors , "query string" );
481495
@@ -505,6 +519,8 @@ static zend_result php_uri_parser_whatwg_fragment_write(void *uri, zval *value,
505519
506520 zval_string_or_null_to_lexbor_str (value , & str );
507521
522+ lxb_url_parser_clean (& lexbor_parser );
523+
508524 if (lxb_url_api_hash_set (lexbor_uri , & lexbor_parser , str .data , str .length ) != LXB_STATUS_OK ) {
509525 throw_invalid_url_exception_during_write (errors , "fragment" );
510526
0 commit comments