From 954f1be44d4c35ca2be0c4ec82ef00198c5d5229 Mon Sep 17 00:00:00 2001 From: kuaifan Date: Thu, 9 Mar 2023 13:25:16 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96=E9=93=BE=E6=8E=A5?= =?UTF-8?q?=E8=AF=86=E5=88=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Models/WebSocketDialogMsg.php | 2 +- resources/assets/js/functions/web.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Models/WebSocketDialogMsg.php b/app/Models/WebSocketDialogMsg.php index a267ef162..a28450fd5 100644 --- a/app/Models/WebSocketDialogMsg.php +++ b/app/Models/WebSocketDialogMsg.php @@ -725,7 +725,7 @@ class WebSocketDialogMsg extends AbstractModel $text = str_replace($str, "[:LINK:{$herf}:{$title}:]", $text); } // 文件分享链接 - preg_match_all("/(https*:\/\/)((\w|=|\?|\.|\/|&|-|:|\+|%|;|#)+)/i", $text, $matchs); + preg_match_all("/(https*:\/\/)((\w|=|\?|\.|\/|&|-|:|\+|%|;|#|@|,|!)+)/i", $text, $matchs); if ($matchs) { foreach ($matchs[0] as $str) { preg_match("/\/single\/file\/(.*?)$/i", $str, $match); diff --git a/resources/assets/js/functions/web.js b/resources/assets/js/functions/web.js index 93b955298..19bfd353c 100755 --- a/resources/assets/js/functions/web.js +++ b/resources/assets/js/functions/web.js @@ -726,7 +726,7 @@ if (/https*:\/\//.test(text)) { text = text.split(/(<[^>]*>)/g).map(string => { if (string && !/<[^>]*>/.test(string)) { - string = string.replace(/(^|[^'"])((https*:\/\/)((\w|=|\?|\.|\/|&|-|:|\+|%|;|#)+))/g, "$1$2") + string = string.replace(/(^|[^'"])((https*:\/\/)((\w|=|\?|\.|\/|&|-|:|\+|%|;|#|@|,|!)+))/g, "$1$2") } return string; }).join("")