From ed2914f2aafdd2199a0e718ffbca61f9f3f2e985 Mon Sep 17 00:00:00 2001 From: Craig Raw Date: Mon, 6 Sep 2021 14:49:53 +0200 Subject: [PATCH] replace illegal filename characters in wallet name with underscores --- .../com/sparrowwallet/sparrow/control/WalletNameDialog.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/com/sparrowwallet/sparrow/control/WalletNameDialog.java b/src/main/java/com/sparrowwallet/sparrow/control/WalletNameDialog.java index a7f8a996..c628766d 100644 --- a/src/main/java/com/sparrowwallet/sparrow/control/WalletNameDialog.java +++ b/src/main/java/com/sparrowwallet/sparrow/control/WalletNameDialog.java @@ -53,6 +53,10 @@ public class WalletNameDialog extends Dialog final VBox content = new VBox(20); name = (CustomTextField)TextFields.createClearableTextField(); name.setText(initialName); + name.setTextFormatter(new TextFormatter<>((change) -> { + change.setText(change.getText().replaceAll("[\\\\/:*?\"<>|]", "_")); + return change; + })); content.getChildren().add(name); HBox existingBox = new HBox(10);