From 2a8071da29f4f63b23c2ea7cbeea10b8830d9a0e Mon Sep 17 00:00:00 2001 From: Andrew Morgan Date: Tue, 29 Mar 2016 14:11:35 -0400 Subject: [PATCH] Prevent regex capture from extended past line boundaries. --- src/chatlog/chatmessage.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chatlog/chatmessage.cpp b/src/chatlog/chatmessage.cpp index 6a742301f..89a2cb1e1 100644 --- a/src/chatlog/chatmessage.cpp +++ b/src/chatlog/chatmessage.cpp @@ -249,7 +249,7 @@ QString ChatMessage::detectAnchors(const QString &str) "(?:\\b)((www\\.)|(http[s]?|ftp)://)" // (protocol)://(printable - non-special character) // http://ONEORMOREALHPA-DIGIT "\\w+\\S+)" // any other character, lets domains and other - "|(?:\\b)(file:///.*$)" //link to a local file, valid until the end of the line + "|(?:\\b)(file:///)([\\S| ]*)" //link to a local file, valid until the end of the line "|(?:\\b)(tox:[a-zA-Z\\d]{76}$)" //link with full user address "|(?:\\b)(mailto:\\S+@\\S+\\.\\S+)" //@mail link "|(?:\\b)(tox:\\S+@\\S+)"); // starts with `tox` then : and only alpha-digits till the end