mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-31 16:18:23 +00:00
fix: 任务内容保存后图片消失的情况
This commit is contained in:
parent
00eb8f7b01
commit
fba98db7cb
@ -84,8 +84,9 @@ class ProjectTaskContent extends AbstractModel
|
|||||||
$content = str_replace($matchs[0][$key], '<img src="{{RemoteURL}}' . $tmpPath . '" original-width="' . $paramet[0] . '" original-height="' . $paramet[1] . '"', $content);
|
$content = str_replace($matchs[0][$key], '<img src="{{RemoteURL}}' . $tmpPath . '" original-width="' . $paramet[0] . '" original-height="' . $paramet[1] . '"', $content);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$pattern = '/<img(.*?)src=("|\')https*:\/\/(.*?)\/(uploads\/task\/content\/(.*?))\2/is';
|
$pattern = '/(<img[^>]*?src=["\'])(https?:\/\/[^\/]+)(\/uploads\/task\/content\/[^\s"\'>]+)(["\'][^>]*?>)/i';
|
||||||
$content = preg_replace($pattern, '<img$1src=$2{{RemoteURL}}$4$2', $content);
|
$replacement = '$1{{RemoteURL}}$3$4';
|
||||||
|
$content = preg_replace($pattern, $replacement, $content);
|
||||||
//
|
//
|
||||||
$filePath = $path . md5($content);
|
$filePath = $path . md5($content);
|
||||||
$publicPath = public_path($filePath);
|
$publicPath = public_path($filePath);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user