mirror of
https://github.com/twisterarmy/cloud-server.git
synced 2025-03-12 13:31:04 +00:00
fix link replacement
This commit is contained in:
parent
5877387c70
commit
22fe7b3610
@ -49,7 +49,7 @@ class Format {
|
||||
public static function post(string $text) {
|
||||
|
||||
$text = preg_replace("|@([a-zA-Z0-9_]+)|i", "<a href=\"people/$1\">@$1</a>", $text);
|
||||
$text = preg_replace("|((https?://)?([\d\w\.-]+\.[\w\.]{2,6})[^\s\]\[\<\>]*/?)|i", "<a href=\"$1\" target=\"_blank\">$3</a>", $text);
|
||||
$text = preg_replace("|((https?://)+([\d\w\.-]+\.[\w\.]{2,6})[^\s\]\[\<\>]*/?)|i", "<a href=\"$1\" target=\"_blank\">$3</a>", $text);
|
||||
$text = nl2br($text);
|
||||
|
||||
return $text;
|
||||
|
Loading…
x
Reference in New Issue
Block a user