去除xss空格过滤
This commit is contained in:
parent
590a039f10
commit
7c8c692e87
@ -93,8 +93,8 @@ public class XssHttpServletRequestWrapper extends HttpServletRequestWrapper {
|
||||
private String cleanXSS(String value) {
|
||||
if (value != null) {
|
||||
//推荐使用ESAPI库来避免脚本攻击,value = ESAPI.encoder().canonicalize(value);
|
||||
// 避免空字符串
|
||||
value = value.replaceAll(" ", "");
|
||||
// // 避免空字符串
|
||||
// value = value.replaceAll(" ", "");
|
||||
// 避免script 标签
|
||||
Pattern scriptPattern = Pattern.compile("<script>(.*?)</script>", Pattern.CASE_INSENSITIVE);
|
||||
value = scriptPattern.matcher(value).replaceAll("");
|
||||
|
@ -29,7 +29,7 @@ public class AppVersionServiceImpl extends ServiceImpl<AppVersionMapper, AppVers
|
||||
@Override
|
||||
public boolean checkAppVersion(AppVersion appVersion) {
|
||||
//检测版本是否存在
|
||||
if(null!=this.getOne(new LambdaQueryWrapper<AppVersion>().eq(AppVersion::getVersion,appVersion))){
|
||||
if(null!=this.getOne(new LambdaQueryWrapper<AppVersion>().eq(AppVersion::getVersion,appVersion.getVersion()))){
|
||||
throw new ServiceException(ResultCode.APP_VERSION_EXIST);
|
||||
}
|
||||
return true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user