I was looking through the Underscore.js api and I noticed that _.escape
escapes &
, <
, >
, "
, '
, and /
characters. What surprised me was escaping /
.
Is there a reason to escape /
characters that I don't know about?
I was looking through the Underscore.js api and I noticed that _.escape
escapes &
, <
, >
, "
, '
, and /
characters. What surprised me was escaping /
.
Is there a reason to escape /
characters that I don't know about?
A lot of time passed but I found same issue. The strange is that the list of changes on the code are according to underscore github
var escapeMap = {
'&': '&',
'<': '<',
'>': '>',
'"': '"',
"'": ''',
'`': '`'
};
EDIT: Alright, apparently, it is recommended by OWASP as it "helps end a HTML entity".