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

Consider non-ASCII characters in domains. #18

Open
spladug opened this issue Nov 28, 2011 · 1 comment
Open

Consider non-ASCII characters in domains. #18

spladug opened this issue Nov 28, 2011 · 1 comment

Comments

@spladug
Copy link
Contributor

spladug commented Nov 28, 2011

No description provided.

@jamt9000
Copy link

To summarise the issues:

For inline links, a non-ASCII character immediately after the protocol (or pseudo-protocol eg. '#', '/') will cause the link to fail due to isalnum checking in sd_autolink_issafe, called from rndr_link. So [](http://www.☃.net/) works, [](http://☃.net/) fails.

For autolinks, the above bug still occurs (because sd_autolink_issafe is called from sd_autolink__url) , but additionally any non-ASCII character appearing 1) anywhere before the first period in the domain or 2) immediately after a period will cause the link to fail due to overzealous check_domain, which will miscount the number of periods in the domain due to breaking from the loop at the first non-alnum-or-dash character encountered (check_domain assumes the domain has a period in, which is isn't always the case, eg http://io). Use of isalnum(data[0]) would also cause a problem, but it is masked by the previous bug.

So:
http://☃.net fails (sd_autolink_issafe)
http://a☃b.net fails (np = 0 since break before period)
http://www.a☃b.net works
http://www.☃b.net fails (isalnum(data[i - 1]) = 0 since data[i-1] is period)
http://www.a☃.net works
http://www.a☃ works

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

No branches or pull requests

2 participants