From e6ddfa490325a7b16d7267647b0de99cfb658ee1 Mon Sep 17 00:00:00 2001 From: Lajamerr Mittesdine Date: Mon, 4 Jun 2018 22:26:58 -0400 Subject: [PATCH] RFC Compliant URL Matching Implemented https://gist.github.com/dperini/729294 in C++ This makes URL Validation / Matching RFC compliant. --- src/messages/messagebuilder.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/messages/messagebuilder.cpp b/src/messages/messagebuilder.cpp index 56dc86cf2..9a6ff88eb 100644 --- a/src/messages/messagebuilder.cpp +++ b/src/messages/messagebuilder.cpp @@ -65,7 +65,7 @@ QString MessageBuilder::matchLink(const QString &string) "(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))" "|" // host name - "(?:(?:[a-z\\x{00a1}-\\x{ffff}0-9]-*)*[a-z\\x{00a1}-\\x{ffff}0-9]+)" + "(?:(?:[_a-z\\x{00a1}-\\x{ffff}0-9]-*)*[a-z\\x{00a1}-\\x{ffff}0-9]+)" // domain name "(?:\\.(?:[a-z\\x{00a1}-\\x{ffff}0-9]-*)*[a-z\\x{00a1}-\\x{ffff}0-9]+)*" // TLD identifier