You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After reading about replacing one char after another is not a best practice (due to the order dependency of replacing and xss risk), I would suggest something like
function escape(s) {
var escaped = {
'&': '&',
'<': '<',
'>': '>',
"'": ''',
'"': '"'
};
return s.replace(/[&<>'"]/g, function (m) {
return escaped[m];
});
}
https://github.com/rstudio/shiny/blob/master/srcjs/utils.js#L1
After reading about replacing one char after another is not a best practice (due to the order dependency of replacing and xss risk), I would suggest something like
Credits to https://gist.github.com/WebReflection/df05641bd04954f6d366.
If you think there is some point here, I may prepare a PR.
The text was updated successfully, but these errors were encountered: