-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
bug HTML.escape #3233
Comments
ruby uses this TABLE_FOR_ESCAPE_HTML__ = {
"&" => "&",
"\"" => """,
"<" => "<",
">" => ">"
} |
They were originally those, until this happened: #2175 As with anything web-related, I don't know what's the correct answer, or which of the RFCs that apply to this case, if any, we should follow. |
It definitely feels as if something is amiss, because I believe I should be able to do the following: something.ecr However with today's HTML.escape, if there are "=" in my_url, I'll end up with a URL like which is "not the right url" and not received correctly by the host. Django seems to differentiate "javascript escape" from HTML escapes FWIW. https://docs.djangoproject.com/en/1.10/_modules/django/utils/html/#escape and from this link (of #2175) "rule #1" HTML escape:
which is quite a similar list, and it also then differentiates between that, attribute, and javascript escaping. So sounds like there are a lot of different types of escapes actually in use today. I'd be happy to hack up something to have three different escape methods if that would be useful. What this does mean though, however, is that the current escape mechanism "doesn't work" for (at least) escaping links today and requires local workarounds like this: Thanks all. |
Maybe a parameter, or a few methods to selectively encode few or many characters? |
there's also Rack::Utils.escape_html. it uses a small hash table, similar to CGI.escape_html. ESCAPE_HTML =
{
"&" => "&",
"<" => "<",
">" => ">",
"'" => "'",
'"' => """,
"/" => "/"
} |
Yes, it seems that "normal" escape is those chars. If I knew what is the On Tue, Nov 1, 2016 at 3:19 AM, jazzonmymind [email protected]
|
…Escapes '&', '"', '\'', '/', '<' and '>' chars only. Extended escaping still available as an Extended option. Short escaping like Ruby one now available as a Short option. Fixes crystal-lang#3233, refs crystal-lang#2175.
…Escapes '&', '"', '\'', '/', '<' and '>' chars only. Extended escaping still available as an Extended option. Short escaping like Ruby one now available as a Short option. Fixes crystal-lang#3233, refs crystal-lang#2175.
…Escapes '&', '"', '\'', '/', '<' and '>' chars only. XSS escaping still available as a XSS option. Short escaping like Ruby one now available as a Short option. Fixes crystal-lang#3233, refs crystal-lang#2175.
…Escapes '&', '"', '\'', '/', '<' and '>' chars only. XSS escaping still available as a XSS option. Short escaping like Ruby one now available as a Short option. Fixes crystal-lang#3233, refs crystal-lang#2175.
still open ? :/ |
yes
…On Wed, Sep 20, 2017 at 2:26 AM, Rubi Jihantoro ***@***.***> wrote:
still open ? :/
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#3233 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAAw0PawyJgLmoyrdXwFG4lRqNlEzWQoks5skMwogaJpZM4J0F9f>
.
|
"?a=1&b=2"
i don't may be this is correct, i just rewrite some specs for my project from ruby and find it failed
The text was updated successfully, but these errors were encountered: