From b3f398111209be591154ecf96a0f62072363a2fa Mon Sep 17 00:00:00 2001 From: "WIN-C27C5MSVTPO\\16961" <1696136552@qq.com> Date: Fri, 8 Aug 2025 14:12:31 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B7=A5=E5=8D=95=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/ticket/service/TicketService.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/ticket/service/TicketService.php b/app/ticket/service/TicketService.php index e225dec..7f74902 100644 --- a/app/ticket/service/TicketService.php +++ b/app/ticket/service/TicketService.php @@ -45,9 +45,10 @@ class TicketService (new AttachmentLogic())->adds($attachment, $result->id, $data['user_id']); } + $cleanContent = trim(preg_replace('/\s+/', ' ', strip_tags($data['content'] ?? ''))); $conversation = [ 'ticket_id' => $result->id, - 'content' => $data['content'], + 'content' => $cleanContent, 'user_id' => $data['user_id'], ]; (new ConversationService())->add($conversation);