Skip to content

Conversation

AstroProfundis
Copy link

This PR updates the regrex used to validate base URL and allow 1-char short base domain like x.com for example.

I didn't figured out the meaning of . in http pattern matching group so I've removed it, as well as adjusted the pattern.

I've tested the pattern with https://regex101.com/ and the following test cases:

https://example.com
http://example.com
https://x.com
http://x.com
https://.null
http://.null
https://x.x
http://x.x
https://sth.longer
http://sth.longer
https://sth.reallylong
http://sth.reallylong

And I've also manually updated the plugin installed on my WP and it appears working as expected.

@AstroProfundis
Copy link
Author

PS, current pattern allows \-@:%._\+~#= as the first char of domain, I'm not sure if this could also be a problem. I'd guess it might be useful to support basic auth?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant