Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ext/lexbor/lexbor/url/url.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
9 changes: 9 additions & 0 deletions ext/lexbor/lexbor/url/url.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down
44 changes: 44 additions & 0 deletions ext/lexbor/patches/0007-Add-Is_Special_Url_Support.patch
Original file line number Diff line number Diff line change
@@ -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.
*/