From 94932c748687443507b51e500174a2402a606357 Mon Sep 17 00:00:00 2001 From: kuaifan Date: Tue, 25 Feb 2025 17:38:12 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96=E5=9B=BE=E6=96=87?= =?UTF-8?q?=E6=B6=88=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Models/WebSocketDialogMsg.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/Models/WebSocketDialogMsg.php b/app/Models/WebSocketDialogMsg.php index 848aba533..ac08f239e 100644 --- a/app/Models/WebSocketDialogMsg.php +++ b/app/Models/WebSocketDialogMsg.php @@ -899,8 +899,12 @@ class WebSocketDialogMsg extends AbstractModel $imageSaveLocal = Base::settingFind("system", "image_save_local"); preg_match_all("/]*?src=([\"'])(.*?(png|jpg|jpeg|webp|gif).*?)\\1[^>]*?>/is", $text, $matchs); foreach ($matchs[2] as $key => $str) { + $parsed = parse_url($str); + if (str_starts_with($parsed['path'], "/uploads/")) { + $str = "{{RemoteURL}}" . ltrim($parsed['path'], "/"); + } if ($imageSaveLocal === 'close') { - $imageSize = getimagesize($str); + $imageSize = @getimagesize($str); if ($imageSize === false) { $imageSize = ["auto", "auto"]; }