From f4064dfcfb9c5029a0f2eba6b4002746c7c92f44 Mon Sep 17 00:00:00 2001 From: jmacxx <47253594+jmacxx@users.noreply.github.com> Date: Sun, 10 May 2020 16:40:36 -0500 Subject: [PATCH] Fix address validation for whitespace after comma Typical comma separated values have a space after each comma in order to make the list more human-readable. In some areas of bisq, comma separated lists are generated this way (see #4203), but the validation of comma separated addresses was not accepting spaces after commas. This change to the regex allows optional whitespace after comma separators. A new test has been added to validate the scenario of whitespace after comma. Fixes #4203 --- desktop/src/main/java/bisq/desktop/util/GUIUtil.java | 2 +- desktop/src/test/java/bisq/desktop/util/GUIUtilTest.java | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/desktop/src/main/java/bisq/desktop/util/GUIUtil.java b/desktop/src/main/java/bisq/desktop/util/GUIUtil.java index fb66e3f3a00..a7ddf443909 100644 --- a/desktop/src/main/java/bisq/desktop/util/GUIUtil.java +++ b/desktop/src/main/java/bisq/desktop/util/GUIUtil.java @@ -1152,7 +1152,7 @@ public static RegexValidator addressRegexValidator() { ")"; // (IPv4-Embedded IPv6 Address) ipv6RegexPattern = String.format("(?:%1$s)|(?:\\[%1$s\\]\\:%2$s)", ipv6RegexPattern, portRegexPattern); String fqdnRegexPattern = String.format("(((?!-)[a-zA-Z0-9-]{1,63}(?