Why does some url validators don't let urls to have '--'?
I recently开发者_Python百科 experienced problems with some urls. If a website has '--' (2x minus sign) in url, it doesn't pass some url validators, for example it's impossible to submit it to website catalog or even twitter: http://twitter.com/share?text=test&url=http://test--test.com
(link with one minus sign )Why do those validators don't let urls with '--' pass? Is this a bug, or a feature?
edit: I can add that that kind of links works with google.
Most validation algorithms don't follow RFC's for web URL's (and often other things like email addresses) for a variety of reasons. Some of the reasons could be:
- Fully validating a URL can be very processor intensive.
- You can leave yourself open to vulnerabilities.
It should be noted that this will become even more of an issue as more international domain names are being used (with characters other than standard ASCII).
Most likely it's because of an overzealous SQL injection detection mechanism. -- marks the start of a comment in some SQL systems.
精彩评论