From 8df2cf71636111323d4b6d17ae0aa52f9392563b Mon Sep 17 00:00:00 2001 From: kradchen Date: Thu, 4 Sep 2025 09:39:14 +0800 Subject: [PATCH] fix: fix port format validation bug --- src/utilities/InputFormatValidator.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utilities/InputFormatValidator.cpp b/src/utilities/InputFormatValidator.cpp index 3b18063..6a6076b 100644 --- a/src/utilities/InputFormatValidator.cpp +++ b/src/utilities/InputFormatValidator.cpp @@ -16,6 +16,6 @@ bool InputFormatValidator::ValidateIpAddressFormat(const QString &aIpAddress) bool InputFormatValidator::ValidatePortFormat(const QString& aPort) { - QRegularExpression regex("^([1-9]\\d{0,4}|0)$"); + QRegularExpression regex("^(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|6[0-4][0-9]{3}|[1-5][0-9]{4}|[1-9][0-9]{0,3}|0)$"); return regex.match(aPort).hasMatch(); }