Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow 1-char base domain #48

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

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