-
Notifications
You must be signed in to change notification settings - Fork 40
Open
Labels
Description
Description of the bug
If you have an x.com url and have "Validate URL" checked on your field it will fail validation
Steps To Reproduce
To reproduce the behavior:
- Create a core link field and check 'Validate URL'
- Create a new node with that link field and attempt to add an x.com field.
Actual behavior
I get a validation error.
Expected behavior
I expect that url to pass validation.
Additional information
Another problem with the current host validation is it allows a trailing slash like a-.com. We need to make sure the following domains pass host validation correctly:
- x.com ✅
- a.io ✅
- -a.com ❌
- a-.com ❌
- -.com ❌
Chat GPT tells me this would be a better solution for that regex but of course we'd have to test all those out:
[a-z0-9](?:[a-z0-9\-]{0,61}[a-z0-9])?
Allows 1-63 characters with no leading or trailing hyphen.
The current one is this:
[a-z0-9][a-z0-9\-]{1,62}
I am not a regex superuser so take all this with an extreme grain of salt until we test out the possibilities.