From 0b3ae3f964d94cbef5a9fc939f42555bd4ba8b9e Mon Sep 17 00:00:00 2001 From: bwcx_jzy Date: Thu, 17 Sep 2020 17:05:02 +0800 Subject: [PATCH] =?UTF-8?q?jvm=20=E5=8F=82=E6=95=B0=E5=92=8C=20=20args=20?= =?UTF-8?q?=E5=8F=82=E6=95=B0url=E7=BC=96=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../io/jpom/model/data/ProjectInfoModel.java | 44 ++++++++++++++++--- 1 file changed, 38 insertions(+), 6 deletions(-) diff --git a/modules/agent/src/main/java/io/jpom/model/data/ProjectInfoModel.java b/modules/agent/src/main/java/io/jpom/model/data/ProjectInfoModel.java index bfcc42cf6..ec5c686eb 100644 --- a/modules/agent/src/main/java/io/jpom/model/data/ProjectInfoModel.java +++ b/modules/agent/src/main/java/io/jpom/model/data/ProjectInfoModel.java @@ -4,7 +4,9 @@ import cn.hutool.core.collection.CollUtil; import cn.hutool.core.io.FileUtil; import cn.hutool.core.util.ArrayUtil; import cn.hutool.core.util.StrUtil; +import cn.hutool.http.HtmlUtil; import cn.jiangzeyin.common.DefaultSystemLog; +import cn.jiangzeyin.common.request.XssFilter; import cn.jiangzeyin.common.spring.SpringUtil; import io.jpom.common.commander.AbstractProjectCommander; import io.jpom.model.BaseJsonModel; @@ -188,11 +190,19 @@ public class ProjectInfoModel extends BaseModel { } public String getJvm() { - return StrUtil.emptyToDefault(jvm, StrUtil.EMPTY); + String s = StrUtil.emptyToDefault(jvm, StrUtil.EMPTY); + if (XssFilter.isXSS()) { + s = HtmlUtil.unescape(s); + } + return s; } public void setJvm(String jvm) { - this.jvm = jvm; + if (XssFilter.isXSS()) { + this.jvm = HtmlUtil.unescape(jvm); + } else { + this.jvm = jvm; + } } public String getGroup() { @@ -392,11 +402,19 @@ public class ProjectInfoModel extends BaseModel { } public String getArgs() { - return StrUtil.emptyToDefault(args, StrUtil.EMPTY); + String s = StrUtil.emptyToDefault(args, StrUtil.EMPTY); + if (XssFilter.isXSS()) { + s = HtmlUtil.unescape(s); + } + return s; } public void setArgs(String args) { - this.args = args; + if (XssFilter.isXSS()) { + this.args = HtmlUtil.unescape(args); + } else { + this.args = args; + } } public String getJdkId() { @@ -515,19 +533,33 @@ public class ProjectInfoModel extends BaseModel { } public String getJvm() { + if (XssFilter.isXSS()) { + return HtmlUtil.unescape(jvm); + } return jvm; } public void setJvm(String jvm) { - this.jvm = jvm; + if (XssFilter.isXSS()) { + this.jvm = HtmlUtil.unescape(jvm); + } else { + this.jvm = jvm; + } } public String getArgs() { + if (XssFilter.isXSS()) { + return HtmlUtil.unescape(args); + } return args; } public void setArgs(String args) { - this.args = args; + if (XssFilter.isXSS()) { + this.args = HtmlUtil.unescape(args); + } else { + this.args = args; + } } @Override