mirror of
https://github.com/kuaifan/dootask.git
synced 2026-02-21 16:00:31 +00:00
no message
This commit is contained in:
parent
535648f918
commit
983b2e43e1
@ -699,7 +699,16 @@ class WebSocketDialogMsg extends AbstractModel
|
|||||||
$text = preg_replace("/\[:#:(.*?):(.*?):\]/i", "<span class=\"mention task\" data-id=\"$1\">#$2</span>", $text);
|
$text = preg_replace("/\[:#:(.*?):(.*?):\]/i", "<span class=\"mention task\" data-id=\"$1\">#$2</span>", $text);
|
||||||
$text = preg_replace("/\[:~:(.*?):(.*?):\]/i", "<a class=\"mention file\" href=\"{{RemoteURL}}single/file/$1\" target=\"_blank\">~$2</a>", $text);
|
$text = preg_replace("/\[:~:(.*?):(.*?):\]/i", "<a class=\"mention file\" href=\"{{RemoteURL}}single/file/$1\" target=\"_blank\">~$2</a>", $text);
|
||||||
$text = preg_replace_callback("/\[:LINK:(.*?):(.*?):\]/i", function (array $match) {
|
$text = preg_replace_callback("/\[:LINK:(.*?):(.*?):\]/i", function (array $match) {
|
||||||
return "<a href=\"" . base64_decode($match[1]) . "\" target=\"_blank\">" . base64_decode($match[2]) . "</a>";
|
$link = base64_decode($match[1]);
|
||||||
|
$title = base64_decode($match[2]);
|
||||||
|
preg_match("/\/single\/file\/(.*?)$/i", $title, $match);
|
||||||
|
if ($match && strlen($match[1]) >= 32) {
|
||||||
|
$file = File::select(['files.id', 'files.name', 'files.ext'])->join('file_links as L', 'files.id', '=', 'L.file_id')->where('L.code', $match[1])->first();
|
||||||
|
if ($file && $file->name) {
|
||||||
|
$title = $file->ext ? "{$file->name}.{$file->ext}" : $file->name;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return "<a href=\"{$link}\" target=\"_blank\">{$title}</a>";
|
||||||
}, $text);
|
}, $text);
|
||||||
return preg_replace("/^(<p><\/p>)+|(<p><\/p>)+$/i", "", $text);
|
return preg_replace("/^(<p><\/p>)+|(<p><\/p>)+$/i", "", $text);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user