Home > Q&A > body text
demo
类似这种简单的输入框,输入不限制特殊字符输入的情况下,怎么去检测处理类似这种问题。
直接检测 "<script>" 字符串来 判断处理么?
这方面问题有什么比较好的处理方案么?
就这么如下处理的话,在前端安全方面还有哪些很欠考虑的点呢?
var html = html.replace(/</g, "<").replace(/>/g, ">");
PHPz2017-04-10 14:50:22
https://github.com/leizongmin/js-xss