From 8e6d37596693738a1bf22ae1739fad17ce9de3b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Mon, 17 Nov 2025 19:28:51 +0100 Subject: [PATCH] lexbor: Cherry pick "URL: the cloning function does not copy the type for IPv4 and IPv6." see lexbor/lexbor@dcfcd645c672816ca8dc2335dfd1402b0a4aa40c Fixes php/php-src#20501 --- NEWS | 4 ++++ ext/lexbor/lexbor/url/url.c | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/NEWS b/NEWS index 38d8d734a04..ef086acf89f 100644 --- a/NEWS +++ b/NEWS @@ -22,6 +22,10 @@ PHP NEWS . Fixed bug GH-20483 (ASAN stack overflow with fiber.stack_size INI small value). (David Carlier) +- Lexbor: + . Fixed bug GH-20501 (\Uri\WhatWg\Url lose host after calling + withPath() or withQuery()). (lexborisov) + - Opcache: . Fixed bug GH-20329 (opcache.file_cache broken with full interned string buffer). (Arnaud) diff --git a/ext/lexbor/lexbor/url/url.c b/ext/lexbor/lexbor/url/url.c index 7bfc007e622..99ba809b05f 100644 --- a/ext/lexbor/lexbor/url/url.c +++ b/ext/lexbor/lexbor/url/url.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2023-2024 Alexander Borisov + * Copyright (C) 2023-2025 Alexander Borisov * * Author: Alexander Borisov */ @@ -1106,9 +1106,9 @@ lxb_url_host_copy(const lxb_url_host_t *src, lxb_url_host_t *dst, } } - if (src->type <= LXB_URL_HOST_TYPE_OPAQUE) { - dst->type = src->type; + dst->type = src->type; + if (src->type <= LXB_URL_HOST_TYPE_OPAQUE) { if (src->type == LXB_URL_HOST_TYPE__UNDEF) { return LXB_STATUS_OK; }