Open albanycomputers opened 1 month ago
In the file core/includes/common.inc
function valid_url - line 1427
The two parameters are
Whether the URL is absolute (beginning with a scheme such as "http:").
In the Webform link.inc
The $absolute value is set to TRUE... having an option to select either true or false would be more helpful.
The valid_url is based on RFC 3986 which has been replaced by rfc8820...
There are two layers of validation:
<input type="url">
element which browsers will validate. See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/url. It will accept things like:ssh://user@example.org
mailto://user@example.org
http://example.org
file://c
ftp://user@example.org
feed://example.org
But it will not accept domains without the prefix. It still requires ssh://
, mailto://
, https://
, http://
, file://
, ftp://
, feed://
.
valid_url()
function in Backdrop which is a bit stingier. If $absolute = TRUE
then it will only check ftp://
, http://
, https://
, and feed://
. So it's an option to disable that check, but the browser would still not allow someone to enter example.org
without a prefix. So I don't think that's going to fit your request if just the one check is removed.
Both would have to be optional. And in that case, maybe just use a regular textfield?
I'm getting a lot of people having trouble filling in links... A lot of people are unfamiliar with entering https://
Can the functionality be updated to allow links without https://
Many thanks.