From 43c3afeff78f114bc3b8b281cbdae8c5a700c416 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1t=C3=A9=20Kocsis?= Date: Sat, 27 Sep 2025 13:16:09 +0200 Subject: [PATCH] Fix Uri\WhatWg\Url::withPort() when an invalid value is passed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cherry-picked from https://github.com/lexbor/lexbor/commit/4ccbc549bc46e59b904ea5411dfbc0644b8c67b9 Co-authored-by: Tim Düsterhus --- NEWS | 3 +++ ext/lexbor/lexbor/url/url.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 27a7d04b633b2..10d9064782291 100644 --- a/NEWS +++ b/NEWS @@ -5,6 +5,9 @@ PHP NEWS - Opcache . Fixed segfault in function JIT due to NAN to bool warning. (Girgias) +- URI: + . Fixed Uri\WhatWg\Url::withPort() when an invalid value is passed. (timwolla) + 25 Sep 2025, PHP 8.5.0RC1 - Core: diff --git a/ext/lexbor/lexbor/url/url.c b/ext/lexbor/lexbor/url/url.c index 7bc9a0b8945f4..25c571f1bf34b 100644 --- a/ext/lexbor/lexbor/url/url.c +++ b/ext/lexbor/lexbor/url/url.c @@ -1906,7 +1906,7 @@ lxb_url_parse_basic_h(lxb_url_parser_t *parser, lxb_url_t *url, { if (begin == p) { if (override_state != LXB_URL_STATE__UNDEF) { - lxb_url_parse_return(orig_data, buf, LXB_STATUS_OK); + lxb_url_parse_return(orig_data, buf, LXB_STATUS_ERROR); } state = LXB_URL_STATE_PATH_START_STATE;