replace illegal filename characters in wallet name with underscores

This commit is contained in:
Craig Raw 2021-09-06 14:49:53 +02:00
parent 0b4785e01c
commit ed2914f2aa

View file

@ -53,6 +53,10 @@ public class WalletNameDialog extends Dialog<WalletNameDialog.NameAndBirthDate>
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);