mirror of
https://github.com/Mibew/i18n.git
synced 2025-02-02 09:34:41 +03:00
Beautify regexp for links highlighting in dialogue
This commit is contained in:
parent
36f8f68f9f
commit
338d5a9976
@ -85,7 +85,7 @@ function post_message($threadid, $kind, $message, $from = null, $agentid = null)
|
|||||||
function prepare_html_message($text)
|
function prepare_html_message($text)
|
||||||
{
|
{
|
||||||
$escaped_text = safe_htmlspecialchars($text);
|
$escaped_text = safe_htmlspecialchars($text);
|
||||||
$text_w_links = preg_replace('/(?i)(http|https|ftp):\/\/\S*/', '<a href="$0" target="_blank">$0</a>', $escaped_text);
|
$text_w_links = preg_replace('/(https?|ftp):\/\/\S*/i', '<a href="$0" target="_blank">$0</a>', $escaped_text);
|
||||||
$multiline = str_replace("\n", "<br/>", $text_w_links);
|
$multiline = str_replace("\n", "<br/>", $text_w_links);
|
||||||
return $multiline;
|
return $multiline;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user