From a9b69b1b3d10ff814733607955c581c043252998 Mon Sep 17 00:00:00 2001 From: Calvin Buckley Date: Tue, 23 Sep 2025 15:44:07 -0300 Subject: [PATCH] Fix Uri\WhatWg\Url::withHost() (#19935) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes GH-19913, fixes GH-19918, fixes GH-19920 Cherry-picked from lexbor/lexbor#a766eec632b69a8c3c1987aeb3910d51f110f8dc Co-authored-by: Tim Düsterhus --- NEWS | 1 + ext/lexbor/lexbor/url/url.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index b8e04d9d018..3d425abf554 100644 --- a/NEWS +++ b/NEWS @@ -83,6 +83,7 @@ PHP NEWS . Fixed bug GH-19892 (Refcounting on zend_empty_array). (ilutov, timwolla) . Fixed handling of port numbers > 65535 with the internal `php_uri_parse_to_struct()` API. (timwolla) + . Fix Uri\WhatWg\Url::withHost(). (timwolla) - Windows: . Fix GH-19722 (_get_osfhandle asserts in debug mode when given a socket). diff --git a/ext/lexbor/lexbor/url/url.c b/ext/lexbor/lexbor/url/url.c index 9185d77d354..7bc9a0b8945 100644 --- a/ext/lexbor/lexbor/url/url.c +++ b/ext/lexbor/lexbor/url/url.c @@ -4246,7 +4246,8 @@ lxb_url_host_set_h(lxb_url_t *url, lxb_url_parser_t *parser, lxb_url_parser_t self_parser; const lxb_char_t tmp[1] = ""; - if (url->host.type == LXB_URL_HOST_TYPE_OPAQUE) { + /* If this’s URL has an opaque path, then return. */ + if (url->path.opaque) { return LXB_STATUS_OK; }