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 <auer.chrisi@gmx.net>
This commit is contained in:
Christoph 2017-03-23 15:56:51 +01:00 committed by John Preston
parent 47044ab25e
commit be659e2611
1 changed files with 1 additions and 1 deletions

View File

@ -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)) {