mirror of
https://github.com/201206030/novel-plus.git
synced 2025-04-26 17:20:52 +00:00
fix(data submit): Xss攻击
This commit is contained in:
parent
f28dd867ef
commit
655ec90906
@ -14,11 +14,6 @@ import java.util.List;
|
||||
*/
|
||||
public class XssHttpServletRequestWrapper extends HttpServletRequestWrapper {
|
||||
|
||||
/**
|
||||
* 假如有有html 代码是自己传来的 需要设定对应的name 不过滤
|
||||
*/
|
||||
private static final List<String> noFilterNames = Arrays.asList("content");
|
||||
|
||||
/**
|
||||
* @param request
|
||||
*/
|
||||
@ -29,7 +24,7 @@ public class XssHttpServletRequestWrapper extends HttpServletRequestWrapper {
|
||||
@Override
|
||||
public String[] getParameterValues(String name) {
|
||||
String[] values = super.getParameterValues(name);
|
||||
if (!noFilterNames.contains(name) && values != null) {
|
||||
if (values != null) {
|
||||
int length = values.length;
|
||||
String[] escapseValues = new String[length];
|
||||
for (int i = 0; i < length; i++) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user