mirror of
https://github.com/kuaifan/dootask.git
synced 2026-02-21 07:50:30 +00:00
perf: 优化图文消息
This commit is contained in:
parent
a1920745fb
commit
94932c7486
@ -899,8 +899,12 @@ class WebSocketDialogMsg extends AbstractModel
|
|||||||
$imageSaveLocal = Base::settingFind("system", "image_save_local");
|
$imageSaveLocal = Base::settingFind("system", "image_save_local");
|
||||||
preg_match_all("/<img[^>]*?src=([\"'])(.*?(png|jpg|jpeg|webp|gif).*?)\\1[^>]*?>/is", $text, $matchs);
|
preg_match_all("/<img[^>]*?src=([\"'])(.*?(png|jpg|jpeg|webp|gif).*?)\\1[^>]*?>/is", $text, $matchs);
|
||||||
foreach ($matchs[2] as $key => $str) {
|
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') {
|
if ($imageSaveLocal === 'close') {
|
||||||
$imageSize = getimagesize($str);
|
$imageSize = @getimagesize($str);
|
||||||
if ($imageSize === false) {
|
if ($imageSize === false) {
|
||||||
$imageSize = ["auto", "auto"];
|
$imageSize = ["auto", "auto"];
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user