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

isURL not checking for unsafe characters #652

Open
omegdadi opened this issue Apr 17, 2017 · 4 comments
Open

isURL not checking for unsafe characters #652

omegdadi opened this issue Apr 17, 2017 · 4 comments

Comments

@omegdadi
Copy link

URLs should not container any of the following characters. isURL returns true for URLs that contain these characters. They should be encoded within the URL:

" < > # % { } | \ ^ ~ [ ] `
@profnandaa
Copy link
Member

profnandaa commented Jun 26, 2017

@omegdadi -- I want some clarification on this. Don't we have URL's with # e.g. #652 (comment), and %20 (url-encoded space), etc. What's really the valid list of "unsafe" characters?

@omegdadi
Copy link
Author

omegdadi commented Jan 8, 2018

That's a good question. The hash (#) seems to be okay only separate the URL from a fragment identifier, which is not considered part of the URL (e.g. what if your URL has 2, is it valid?). An encoded space is okay, but if you're testing a URL that has a literal space in it, it should fail.

See Character Encoding Chart in this post: https://perishablepress.com/stop-using-unsafe-characters-in-urls/
See page 2 of RFC for unsafe characters: http://www.ietf.org/rfc/rfc1738.txt

@profnandaa
Copy link
Member

@omegdadi - happy to accept PR! 👍

@pano9000
Copy link
Contributor

pano9000 commented Feb 6, 2023

this is largely still valid in the latest version, but < and > do return false now.
The other ones still erroneously return true.

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

No branches or pull requests

4 participants