Rails 中的 XSS JSON
我正在 Rails 中使用 Backbone 渲染内容。我从模型中获取的一些 json 属性将是 html 属性,其中一些可能在 javascript 中使用,而其他属性将插入到 html 元素之间。所有这些都需要不同的转义机制,人们如何处理这个问题?
I'm rendering content using Backbone in Rails. Some of the json properties i'm getting from the models will be html attributes, some of them might be used inside the javascript and others will be inserted between html elements. All of these require different escaping mechanisms, how do people deal with this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
