From 9cf3503a84dd84d18e134fa940accd8f8abcdc0c Mon Sep 17 00:00:00 2001 From: kuaifan Date: Fri, 2 Dec 2022 13:36:40 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96=E6=B6=88=E6=81=AF&am?= =?UTF-8?q?p;=E7=AC=A6=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Models/WebSocketDialogMsg.php | 1 + resources/assets/js/functions/web.js | 1 + 2 files changed, 2 insertions(+) diff --git a/app/Models/WebSocketDialogMsg.php b/app/Models/WebSocketDialogMsg.php index 64eb94c6e..db4d2a8ea 100644 --- a/app/Models/WebSocketDialogMsg.php +++ b/app/Models/WebSocketDialogMsg.php @@ -542,6 +542,7 @@ class WebSocketDialogMsg extends AbstractModel if (!$preserveHtml) { $text = strip_tags($text); $text = str_replace(" ", " ", $text); + $text = str_replace("&", "&", $text); } return $text; } diff --git a/resources/assets/js/functions/web.js b/resources/assets/js/functions/web.js index e7f594423..51ba84fd0 100755 --- a/resources/assets/js/functions/web.js +++ b/resources/assets/js/functions/web.js @@ -376,6 +376,7 @@ text = text.replace(/]*?>/g, `[${$A.L('动画表情')}]`) text = text.replace(/]*?>/g, `[${$A.L('图片')}]`) text = text.replace(/ /g," ") + text = text.replace(/&/g,"&") return text.replace(/<[^>]+>/g,"") },