1+ From 9181fce509ab9b37c02994545f3971687433e770 Mon Sep 17 00:00:00 2001
2+ From: =?UTF-8?q?M=C3=A1t=C3=A9=20Kocsis?= <kocsismate@woohoolabs.com>
3+ Date: Sun, 17 May 2026 22:17:14 +0200
4+ Subject: [PATCH] Add lxb_url_is_special() to the public API (#362)
5+
6+ As https://wiki.php.net/rfc/uri_followup#uri_type_detection relies on this information.
7+ ---
8+ source/lexbor/url/url.c | 2 +-
9+ source/lexbor/url/url.h | 9 +++++++++
10+ 2 files changed, 10 insertions(+), 1 deletion(-)
11+
12+ diff --git a/source/lexbor/url/url.c b/source/lexbor/url/url.c
13+ index 5a114346..a5b323f2 100644
14+ --- a/source/lexbor/url/url.c
15+ +++ b/source/lexbor/url/url.c
16+ @@ -860,7 +860,7 @@ lxb_url_is_url_codepoint(lxb_codepoint_t cp)
17+ return lxb_url_codepoint_alphanumeric[(lxb_char_t) cp] != 0xFF;
18+ }
19+
20+ - lxb_inline bool
21+ + bool
22+ lxb_url_is_special(const lxb_url_t *url)
23+ {
24+ return url->scheme.type != LXB_URL_SCHEMEL_TYPE__UNKNOWN;
25+ diff --git a/source/lexbor/url/url.h b/source/lexbor/url/url.h
26+ index 4ed3f32a..6cc6f108 100644
27+ --- a/source/lexbor/url/url.h
28+ +++ b/source/lexbor/url/url.h
29+ @@ -763,6 +763,15 @@ LXB_API lxb_status_t
30+ lxb_url_search_params_serialize(lxb_url_search_params_t *search_params,
31+ lexbor_callback_f cb, void *ctx);
32+
33+ + /**
34+ + * Returns whether the URL is special.
35+ + *
36+ + * @param[in] lxb_url_t *. Cannot be NULL.
37+ + * @return true if URL is special, false otherwise.
38+ + */
39+ + LXB_API bool
40+ + lxb_url_is_special(const lxb_url_t *url);
41+ +
42+ /*
43+ * Inline functions.
44+ */
0 commit comments