Skip to content

Commit f6d4a8b

Browse files
authored
Fully sanitize wallet name of invalid chars. (#4031)
When a new wallet name has been provided by the user, every instance of invalid characters should be removed from the name, not just the first.
1 parent d705497 commit f6d4a8b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • app/components/views/GetStartedPage/PreCreateWallet

app/components/views/GetStartedPage/PreCreateWallet/hooks.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export const usePreCreateWallet = ({
6464
// Filesystem related chars: /\.:
6565
// Escaped when stored in dcrwallet.conf ini files: ;#[]
6666
// Specially handled by dcrwallet: $%~
67-
const replaceNameChars = /[/\\.:;#[\]$%~]/;
67+
const replaceNameChars = /[/\\.:;#[\]$%~]/g;
6868
newWalletName = newWalletName.replace(replaceNameChars, "");
6969
// Remove leading spaces.
7070
if (newWalletName.length > 0 && newWalletName[0] === " ")

0 commit comments

Comments
 (0)