From be5773bd71288592325a3f63860f0175fa012a85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=81=E7=90=A6=E6=B6=9B?= Date: Tue, 4 Apr 2023 10:44:32 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90fix=20sonar=E3=80=91XSSUtils=E6=96=87?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/jero/modules/system/util/XSSUtils.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/util/XSSUtils.java b/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/util/XSSUtils.java index 31f57771..2c65302d 100644 --- a/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/util/XSSUtils.java +++ b/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/util/XSSUtils.java @@ -35,8 +35,9 @@ public class XSSUtils { value = scriptPattern.matcher(value).replaceAll(""); scriptPattern = Pattern.compile("onload(.*?)=", Pattern.CASE_INSENSITIVE | Pattern.MULTILINE | Pattern.DOTALL); value = scriptPattern.matcher(value).replaceAll(""); + return HtmlUtils.htmlEscape(value); } - return HtmlUtils.htmlEscape(value); + return null; } public static void main(String[] args) {