Commit 4eb76977b9f for php.net
commit 4eb76977b9fabd6af19a60952c456a621bcbab4e
Merge: da637e81912 2587b82759e
Author: Ilija Tovilo <ilija.tovilo@me.com>
Date: Tue Jun 30 01:43:33 2026 +0200
Merge branch 'PHP-8.5'
* PHP-8.5:
Merge Lexbor patch c3a68477399d446660ac241d3a55357dc95c6e81
diff --cc ext/lexbor/patches/0001-Expose-line-and-column-information-for-use-in-PHP.patch
index 04136b29f58,04136b29f58..e106b413c22
--- a/ext/lexbor/patches/0001-Expose-line-and-column-information-for-use-in-PHP.patch
+++ b/ext/lexbor/patches/0001-Expose-line-and-column-information-for-use-in-PHP.patch
@@@ -1,7 -1,7 +1,7 @@@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Niels Dossche <7771979+nielsdos@users.noreply.github.com>
Date: Sat, 26 Aug 2023 15:08:59 +0200
--Subject: [PATCH 1/8] Expose line and column information for use in PHP
++Subject: [PATCH 1/9] Expose line and column information for use in PHP
---
source/lexbor/dom/interfaces/node.h | 2 ++
diff --cc ext/lexbor/patches/0002-Track-implied-added-nodes-for-options-use-in-PHP.patch
index 615655d7f2e,615655d7f2e..9e83700198e
--- a/ext/lexbor/patches/0002-Track-implied-added-nodes-for-options-use-in-PHP.patch
+++ b/ext/lexbor/patches/0002-Track-implied-added-nodes-for-options-use-in-PHP.patch
@@@ -1,7 -1,7 +1,7 @@@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Niels Dossche <7771979+nielsdos@users.noreply.github.com>
Date: Mon, 14 Aug 2023 20:18:51 +0200
--Subject: [PATCH 2/8] Track implied added nodes for options use in PHP
++Subject: [PATCH 2/9] Track implied added nodes for options use in PHP
---
source/lexbor/html/tree.h | 3 +++
diff --cc ext/lexbor/patches/0003-Patch-utilities-and-data-structure-to-be-able-to-gen.patch
index 73c5afa19e1,73c5afa19e1..9ed36fda109
--- a/ext/lexbor/patches/0003-Patch-utilities-and-data-structure-to-be-able-to-gen.patch
+++ b/ext/lexbor/patches/0003-Patch-utilities-and-data-structure-to-be-able-to-gen.patch
@@@ -1,7 -1,7 +1,7 @@@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Niels Dossche <7771979+nielsdos@users.noreply.github.com>
Date: Thu, 24 Aug 2023 22:57:48 +0200
--Subject: [PATCH 3/8] Patch utilities and data structure to be able to generate
++Subject: [PATCH 3/9] Patch utilities and data structure to be able to generate
smaller lookup tables
Changed the generation script to check if everything fits in 32-bits.
diff --cc ext/lexbor/patches/0004-Remove-unused-upper-case-tag-static-data.patch
index cc0a65a7cd5,cc0a65a7cd5..9e9fcaf8db7
--- a/ext/lexbor/patches/0004-Remove-unused-upper-case-tag-static-data.patch
+++ b/ext/lexbor/patches/0004-Remove-unused-upper-case-tag-static-data.patch
@@@ -1,7 -1,7 +1,7 @@@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Niels Dossche <7771979+nielsdos@users.noreply.github.com>
Date: Wed, 29 Nov 2023 21:26:47 +0100
--Subject: [PATCH 4/8] Remove unused upper case tag static data
++Subject: [PATCH 4/9] Remove unused upper case tag static data
---
source/lexbor/tag/res.h | 2 ++
diff --cc ext/lexbor/patches/0005-Shrink-size-of-static-binary-search-tree.patch
index b84120bf6c8,b84120bf6c8..ce344816939
--- a/ext/lexbor/patches/0005-Shrink-size-of-static-binary-search-tree.patch
+++ b/ext/lexbor/patches/0005-Shrink-size-of-static-binary-search-tree.patch
@@@ -1,7 -1,7 +1,7 @@@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Niels Dossche <7771979+nielsdos@users.noreply.github.com>
Date: Wed, 29 Nov 2023 21:29:31 +0100
--Subject: [PATCH 5/8] Shrink size of static binary search tree
++Subject: [PATCH 5/9] Shrink size of static binary search tree
This also makes it more efficient on the data cache.
---
diff --cc ext/lexbor/patches/0006-Patch-out-unused-CSS-style-code.patch
index 196a5a8a62d,196a5a8a62d..c8f485f3480
--- a/ext/lexbor/patches/0006-Patch-out-unused-CSS-style-code.patch
+++ b/ext/lexbor/patches/0006-Patch-out-unused-CSS-style-code.patch
@@@ -1,7 -1,7 +1,7 @@@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Niels Dossche <7771979+nielsdos@users.noreply.github.com>
Date: Sun, 7 Jan 2024 21:59:28 +0100
--Subject: [PATCH 6/8] Patch out unused CSS style code
++Subject: [PATCH 6/9] Patch out unused CSS style code
---
source/lexbor/css/rule.h | 2 ++
diff --cc ext/lexbor/patches/0007-Add-lxb_url_is_special-to-the-public-API-362.patch
index 6a42cdebc12,00000000000..b56a1d1f06a
mode 100644,000000..100644
--- a/ext/lexbor/patches/0007-Add-lxb_url_is_special-to-the-public-API-362.patch
+++ b/ext/lexbor/patches/0007-Add-lxb_url_is_special-to-the-public-API-362.patch
@@@ -1,44 -1,0 +1,44 @@@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?M=C3=A1t=C3=A9=20Kocsis?= <kocsismate@woohoolabs.com>
+Date: Sun, 17 May 2026 22:17:14 +0200
- Subject: [PATCH 7/8] Add lxb_url_is_special() to the public API (#362)
++Subject: [PATCH 7/9] Add lxb_url_is_special() to the public API (#362)
+
+As https://wiki.php.net/rfc/uri_followup#uri_type_detection relies on this information.
+---
+ source/lexbor/url/url.c | 2 +-
+ source/lexbor/url/url.h | 9 +++++++++
+ 2 files changed, 10 insertions(+), 1 deletion(-)
+
+diff --git a/source/lexbor/url/url.c b/source/lexbor/url/url.c
+index 5a11434..a5b323f 100644
+--- a/source/lexbor/url/url.c
++++ b/source/lexbor/url/url.c
+@@ -860,7 +860,7 @@ lxb_url_is_url_codepoint(lxb_codepoint_t cp)
+ return lxb_url_codepoint_alphanumeric[(lxb_char_t) cp] != 0xFF;
+ }
+
+-lxb_inline bool
++bool
+ lxb_url_is_special(const lxb_url_t *url)
+ {
+ return url->scheme.type != LXB_URL_SCHEMEL_TYPE__UNKNOWN;
+diff --git a/source/lexbor/url/url.h b/source/lexbor/url/url.h
+index 4ed3f32..6cc6f10 100644
+--- a/source/lexbor/url/url.h
++++ b/source/lexbor/url/url.h
+@@ -763,6 +763,15 @@ LXB_API lxb_status_t
+ lxb_url_search_params_serialize(lxb_url_search_params_t *search_params,
+ lexbor_callback_f cb, void *ctx);
+
++/**
++ * Returns whether the URL is special.
++ *
++ * @param[in] lxb_url_t *. Cannot be NULL.
++ * @return true if URL is special, false otherwise.
++ */
++LXB_API bool
++lxb_url_is_special(const lxb_url_t *url);
++
+ /*
+ * Inline functions.
+ */
diff --cc ext/lexbor/patches/0008-URL-fixed-setters-for-empty-hosts.patch
index deb1d3abf85,2592372c6b0..de66962e7cc
--- a/ext/lexbor/patches/0008-URL-fixed-setters-for-empty-hosts.patch
+++ b/ext/lexbor/patches/0008-URL-fixed-setters-for-empty-hosts.patch
@@@ -1,7 -1,7 +1,7 @@@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Alexander Borisov <lex.borisov@gmail.com>
Date: Fri, 26 Jun 2026 18:55:56 +0300
- Subject: [PATCH 8/8] URL: fixed setters for empty hosts.
-Subject: [PATCH 7/8] URL: fixed setters for empty hosts.
++Subject: [PATCH 8/9] URL: fixed setters for empty hosts.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
diff --cc ext/lexbor/patches/0009-URL-fixed-uninitialized-memory-in-the-path-buffer-gr.patch
index 00000000000,243053e87fa..0fde094eefd
mode 000000,100644..100644
--- a/ext/lexbor/patches/0009-URL-fixed-uninitialized-memory-in-the-path-buffer-gr.patch
+++ b/ext/lexbor/patches/0009-URL-fixed-uninitialized-memory-in-the-path-buffer-gr.patch
@@@ -1,0 -1,37 +1,37 @@@
+ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+ From: Alexander Borisov <lex.borisov@gmail.com>
+ Date: Fri, 5 Jun 2026 22:13:32 +0300
-Subject: [PATCH 8/8] URL: fixed uninitialized memory in the path buffer
++Subject: [PATCH 9/9] URL: fixed uninitialized memory in the path buffer
+ growth.
+
+ When a path was long enough to outgrow the on-stack buffer, the first
+ move to the heap didn't copy what was already written, so the start of
+ the path could contain garbage. Also fixed the 'last' pointer after the
+ move.
+
+ Per report from Recep Asan (recep@asan.me)
+ ---
+ source/lexbor/url/url.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+ diff --git a/source/lexbor/url/url.c b/source/lexbor/url/url.c
-index 86bcf8f..b6c0a1e 100644
++index 5c6d5cc..1fd044b 100644
+ --- a/source/lexbor/url/url.c
+ +++ b/source/lexbor/url/url.c
+ @@ -499,6 +499,7 @@ lxb_url_scheme_length = sizeof(lxb_url_scheme_res) / sizeof(lxb_url_scheme_data_
+ if (tmp == NULL) { \
+ return NULL; \
+ } \
+ + memcpy(tmp, (sbuf_begin), offset); \
+ } \
+ else { \
+ tmp = lexbor_realloc((sbuf_begin), new_len); \
+ @@ -509,7 +510,7 @@ lxb_url_scheme_length = sizeof(lxb_url_scheme_res) / sizeof(lxb_url_scheme_data_
+ } \
+ \
+ (sbuf) = tmp + offset; \
+ - (last) = sbuf + lst; \
+ + (last) = tmp + lst; \
+ (sbuf_begin) = tmp; \
+ (sbuf_end) = tmp + new_len; \
+ } \