From 338d5a99768271eb735bc2fb4776fb9f941d10a7 Mon Sep 17 00:00:00 2001 From: "Fedor A. Fetisov" Date: Tue, 24 Sep 2013 15:58:44 +0400 Subject: [PATCH] Beautify regexp for links highlighting in dialogue --- src/messenger/webim/libs/chat.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/messenger/webim/libs/chat.php b/src/messenger/webim/libs/chat.php index eb3bee87..e086c448 100644 --- a/src/messenger/webim/libs/chat.php +++ b/src/messenger/webim/libs/chat.php @@ -85,7 +85,7 @@ function post_message($threadid, $kind, $message, $from = null, $agentid = null) function prepare_html_message($text) { $escaped_text = safe_htmlspecialchars($text); - $text_w_links = preg_replace('/(?i)(http|https|ftp):\/\/\S*/', '$0', $escaped_text); + $text_w_links = preg_replace('/(https?|ftp):\/\/\S*/i', '$0', $escaped_text); $multiline = str_replace("\n", "
", $text_w_links); return $multiline; }