Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions ext/uri/tests/whatwg/getters/gh20771.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
--TEST--
GH-20771 (Assertion failure when getUnicodeHost() returns empty string)
--EXTENSIONS--
uri
--FILE--
<?php

$url = Uri\WhatWg\Url::parse('test://');

var_dump($url->getUnicodeHost());

?>
--EXPECT--
string(0) ""
2 changes: 1 addition & 1 deletion ext/uri/uri_parser_whatwg.c
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ static zend_result php_uri_parser_whatwg_host_read(void *uri, php_uri_component_
lxb_url_serialize_host_unicode(&lexbor_idna, &lexbor_uri->host, serialize_to_smart_str_callback, &host_str);
lxb_unicode_idna_clean(&lexbor_idna);

ZVAL_NEW_STR(retval, smart_str_extract(&host_str));
ZVAL_STR(retval, smart_str_extract(&host_str));
break;
}
case PHP_URI_COMPONENT_READ_MODE_NORMALIZED_ASCII:
Expand Down