From be659e2611183c67e4fc14caa5f7229096569009 Mon Sep 17 00:00:00 2001 From: Christoph Date: Thu, 23 Mar 2017 15:56:51 +0100 Subject: [PATCH] Fix regex for in app links (#3142) Before, this regex matched also links which contained a in app link, e.g.: https://github.com/search?q=https://telegram.me/BotFather Fix #3141 Signed-off-by: Christoph --- Telegram/SourceFiles/core/click_handler_types.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/core/click_handler_types.cpp b/Telegram/SourceFiles/core/click_handler_types.cpp index c81fcb0183..268cbc0ee4 100644 --- a/Telegram/SourceFiles/core/click_handler_types.cpp +++ b/Telegram/SourceFiles/core/click_handler_types.cpp @@ -40,7 +40,7 @@ QString tryConvertUrlToLocal(QString url) { using namespace qthelp; auto matchOptions = RegExOption::CaseInsensitive; - auto telegramMeMatch = regex_match(qsl("https?://(www\\.)?(telegram\\.(me|dog)|t\\.me)/(.+)$"), url, matchOptions); + auto telegramMeMatch = regex_match(qsl("^https?://(www\\.)?(telegram\\.(me|dog)|t\\.me)/(.+)$"), url, matchOptions); if (telegramMeMatch) { auto query = telegramMeMatch->capturedRef(4); if (auto joinChatMatch = regex_match(qsl("^joinchat/([a-zA-Z0-9\\.\\_\\-]+)(\\?|$)"), query, matchOptions)) {