Commit 27d7b799c0a for php.net
commit 27d7b799c0a13578ee0506b428b8ddc209ffb010
Author: Máté Kocsis <kocsismate@woohoolabs.com>
Date: Sun May 24 22:37:38 2026 +0200
Add lxb_url_is_special to the public API of Lexbor (#22093)
It's needed to implement https://github.com/php/php-src/pull/22075 for https://wiki.php.net/rfc/uri_followup#uri_type_detection.
Since the upstream changes to lexbor (https://github.com/lexbor/lexbor/pull/362) haven't been released yet, a patch is added for now.
diff --git a/ext/lexbor/lexbor/url/url.c b/ext/lexbor/lexbor/url/url.c
index 5a1143469d1..a5b323f2df0 100644
--- a/ext/lexbor/lexbor/url/url.c
+++ b/ext/lexbor/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/ext/lexbor/lexbor/url/url.h b/ext/lexbor/lexbor/url/url.h
index 4ed3f32aa64..6cc6f1081c8 100644
--- a/ext/lexbor/lexbor/url/url.h
+++ b/ext/lexbor/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 --git a/ext/lexbor/patches/0007-Add-Is_Special_Url_Support.patch b/ext/lexbor/patches/0007-Add-Is_Special_Url_Support.patch
new file mode 100644
index 00000000000..6f5e126336d
--- /dev/null
+++ b/ext/lexbor/patches/0007-Add-Is_Special_Url_Support.patch
@@ -0,0 +1,44 @@
+From 9181fce509ab9b37c02994545f3971687433e770 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] 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 5a114346..a5b323f2 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 4ed3f32a..6cc6f108 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.
+ */
\ No newline at end of file