From c0062a94e826ffb1bce915eb8b2f20958aac1e38 Mon Sep 17 00:00:00 2001 From: 21pages Date: Mon, 27 Jul 2026 20:35:11 +0800 Subject: [PATCH] support Unicode IDs in whitelist settings Signed-off-by: 21pages --- flutter/lib/common/widgets/dialog.dart | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/flutter/lib/common/widgets/dialog.dart b/flutter/lib/common/widgets/dialog.dart index fa5917056..f80603802 100644 --- a/flutter/lib/common/widgets/dialog.dart +++ b/flutter/lib/common/widgets/dialog.dart @@ -362,11 +362,11 @@ void changeIdWhiteList({Function()? callback}) async { .split(RegExp(r"[\s,;\n]+")) .where((e) => e.isNotEmpty) .toList(); - // test id, wildcards '*' and '?' are allowed; - // '@' '.' ':' '/' '[' ']' occur in cross-server IDs and WebSocket URIs - final idMatch = RegExp(r"^[a-zA-Z0-9_*?@.:/\[\]-]+$"); + // Separators are handled above; allow all other Unicode characters. for (final id in ids) { - if (!idMatch.hasMatch(id)) { + final hasControlCharacters = id.runes.any( + (char) => char <= 0x1f || (char >= 0x7f && char <= 0x9f)); + if (hasControlCharacters) { msg = "${translate("Invalid ID")} $id"; setState(() { isInProgress = false;