From 6666bcea964cddf5490ec1ce749926b88b6bd30b Mon Sep 17 00:00:00 2001 From: RustDesk <71636191+rustdesk@users.noreply.github.com> Date: Wed, 15 Jul 2026 10:26:41 +0800 Subject: [PATCH] Update flutter/lib/common/widgets/dialog.dart Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- flutter/lib/common/widgets/dialog.dart | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/flutter/lib/common/widgets/dialog.dart b/flutter/lib/common/widgets/dialog.dart index 16b4ff592..a6a467690 100644 --- a/flutter/lib/common/widgets/dialog.dart +++ b/flutter/lib/common/widgets/dialog.dart @@ -357,11 +357,14 @@ void changeIdWhiteList({Function()? callback}) async { if (newIdWhiteListField.isEmpty) { // pass } else { - final ids = - newIdWhiteListField.trim().split(RegExp(r"[\s,;\n]+")); + final ids = newIdWhiteListField + .trim() + .split(RegExp(r"[\s,;\n]+")) + .where((e) => e.isNotEmpty) + .toList(); // test id, wildcards '*' and '?' are allowed; // '@' '.' ':' occur in cross-server IDs like "123456789@server:port" - final idMatch = RegExp(r"^[a-zA-Z0-9\_\-\*\?\@\.\:]+$"); + final idMatch = RegExp(r"^[a-zA-Z0-9_*?@.:-]+$"); for (final id in ids) { if (!idMatch.hasMatch(id)) { msg = "${translate("Invalid ID")} $id";