From ed80bc90a80d1e69590876b5a94618df6111b5a7 Mon Sep 17 00:00:00 2001 From: Roland Winklmeier Date: Tue, 2 Oct 2018 21:42:56 +0200 Subject: [PATCH] Correct the NetworkVatlib ATIS and password regular expressions The password one was not matching if the integers had multiple digits. The ATIS one was matching on every random 'z' in any ATIS line. ref T380 --- src/blackcore/vatsim/networkvatlib.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/blackcore/vatsim/networkvatlib.cpp b/src/blackcore/vatsim/networkvatlib.cpp index 1a70a941f..1ffa39177 100644 --- a/src/blackcore/vatsim/networkvatlib.cpp +++ b/src/blackcore/vatsim/networkvatlib.cpp @@ -1096,7 +1096,7 @@ namespace BlackCore { if (fsdMessageFiltered.startsWith("FSD Sent=>#AP")) { - thread_local const QRegularExpression re("^(FSD Sent=>#AP\\w+:SERVER:\\d+:)[^:]+(:\\d:\\d+:\\d:.+)$"); + thread_local const QRegularExpression re("^(FSD Sent=>#AP\\w+:SERVER:\\d+:)[^:]+(:\\d+:\\d+:\\d+:.+)$"); fsdMessageFiltered.replace(re, "\\1\\2"); m_filterPasswordFromLogin = false; } @@ -1198,7 +1198,7 @@ namespace BlackCore // 4 digits followed by z (e.g. 0200z) is always the last atis line. // Some controllers leave the logoff time empty. Hence we accept anything // between 0-4 digits. - thread_local const QRegularExpression reLogoff("\\d{0,4}z"); + thread_local const QRegularExpression reLogoff("^\\d{0,4}z$"); if (reLogoff.match(message).hasMatch()) { emit atisLogoffTimeReplyReceived(sender, message);