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

fix: disallow more characters in links #5509

Merged
merged 3 commits into from
Jul 20, 2024

Conversation

Nerixyz
Copy link
Contributor

@Nerixyz Nerixyz commented Jul 14, 2024

As mentioned in #5486, this is the "second" part at making the link parser a bit better. This PR disallows characters from ASCII that aren't valid in domains. Similar to what GFM considers a valid domain, 0-9, A-Z, a-z, '-', '_', and '.' are allowed. However, since the parser should be able to parse "domains" that actually require punycode like https://köln.de, all characters outside ASCII are allowed. I think it's fine to allow these, even though it's a bit wrong.

Fixes #4769.

@Nerixyz Nerixyz force-pushed the fix/check-link-chars branch from 8da3bcb to 528662c Compare July 14, 2024 16:22
@pajlada pajlada enabled auto-merge (squash) July 20, 2024 09:38
@pajlada pajlada merged commit 4a7a5b0 into Chatterino:master Jul 20, 2024
17 checks passed
@Nerixyz Nerixyz deleted the fix/check-link-chars branch July 20, 2024 10:32
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.

non-URI characters should be excluded from the link parser
2 participants