From ccc9bdfbb0bf334893c2e3bc2c11d6c7fc1c7af9 Mon Sep 17 00:00:00 2001 From: falcon4fun Date: Tue, 24 Sep 2013 10:34:53 +0300 Subject: [PATCH 1/2] HTTPS links highlighting Make a https links highlighting too. --- 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 5a2306d1..93708bbe 100644 --- a/src/messenger/webim/libs/chat.php +++ b/src/messenger/webim/libs/chat.php @@ -78,7 +78,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('/(http|ftp):\/\/\S*/', '$0', $escaped_text); + $text_w_links = preg_replace('/(http|https|ftp):\/\/\S*/', '$0', $escaped_text); $multiline = str_replace("\n", "
", $text_w_links); return $multiline; } From 8bf1e34fce93bb3bc4546a618a8c2385b6fc0324 Mon Sep 17 00:00:00 2001 From: falcon4fun Date: Tue, 24 Sep 2013 10:44:30 +0300 Subject: [PATCH 2/2] Update chat.php --- 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 93708bbe..4332ff9e 100644 --- a/src/messenger/webim/libs/chat.php +++ b/src/messenger/webim/libs/chat.php @@ -78,7 +78,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('/(http|https|ftp):\/\/\S*/', '$0', $escaped_text); + $text_w_links = preg_replace('/(?i)(http|https|ftp):\/\/\S*/', '$0', $escaped_text); $multiline = str_replace("\n", "
", $text_w_links); return $multiline; }