diff --git a/app/Models/WebSocketDialogMsg.php b/app/Models/WebSocketDialogMsg.php index 2a67ca38d..895058d1d 100644 --- a/app/Models/WebSocketDialogMsg.php +++ b/app/Models/WebSocketDialogMsg.php @@ -305,9 +305,16 @@ class WebSocketDialogMsg extends AbstractModel preg_match("/data-value=\"(.*?)\"/", $str, $matchValye); $text = str_replace($matchs[0][$key], "[:{$matchChar[1]}:{$matchId[1]}:{$matchValye[1]}:]", $text); } + // 处理链接 + preg_match_all("/]*?href=([\"'])(.*?)\\1[^>]*?>([^<]*?)<\/a>/is", $text, $matchs); + foreach ($matchs[2] as $key => $str) { + $herf = $matchs[2][$key]; + $title = $matchs[3][$key] ?: $herf; + $text = str_replace($matchs[0][$key], "{$title}", $text); + } // 过滤标签 - $text = strip_tags($text, '