fix(Wallet): Don't allow HTML tag special characters in Account Name

Also
- Add maximum character filter (40) not to allow unlimited characters that break
the visualization

updates: #4961
This commit is contained in:
Stefan D 2022-03-24 16:56:43 +02:00 committed by Stefan Dunca
parent b21a8df418
commit 74e2305ec8
5 changed files with 30 additions and 5 deletions

View File

@ -66,8 +66,13 @@ StatusModal {
//% "You need to enter an account name"
errorMessage: qsTrId("you-need-to-enter-an-account-name")
minLength: 1
},
StatusRegularExpressionValidator {
regularExpression: /^[^<>]+$/
errorMessage: qsTr("This is not a valid account name")
}
]
charLimit: 40
}
StatusColorSelectorGrid {
@ -104,7 +109,7 @@ StatusModal {
//% "Change Name"
text: qsTr("Change Name")
enabled: accountNameInput.text !== ""
enabled: accountNameInput.text !== "" && accountNameInput.valid
MessageDialog {
id: changeError

View File

@ -143,8 +143,13 @@ StatusModal {
//% "You need to enter an account name"
errorMessage: qsTrId("you-need-to-enter-an-account-name")
minLength: 1
},
StatusRegularExpressionValidator {
regularExpression: /^[^<>]+$/
errorMessage: qsTr("This is not a valid account name")
}
]
charLimit: 40
}
StatusColorSelectorGrid {
@ -168,7 +173,7 @@ StatusModal {
//% "Add account"
qsTrId("add-account")
enabled: !loading && passwordInput.text !== "" && accountNameInput.text !== "" && accountPKeyInput.text !== ""
enabled: !loading && passwordInput.text !== "" && accountNameInput.text !== "" && accountNameInput.valid && accountPKeyInput.text !== ""
MessageDialog {
id: accountError

View File

@ -131,8 +131,13 @@ StatusModal {
//% "You need to enter an account name"
errorMessage: qsTrId("you-need-to-enter-an-account-name")
minLength: 1
},
StatusRegularExpressionValidator {
regularExpression: /^[^<>]+$/
errorMessage: qsTr("This is not a valid account name")
}
]
charLimit: 40
}
StatusColorSelectorGrid {
@ -156,7 +161,7 @@ StatusModal {
//% "Add account"
qsTrId("add-account")
enabled: !loading && passwordInput.text !== "" && accountNameInput.text !== "" && seedPhraseTextArea.correctWordCount
enabled: !loading && passwordInput.text !== "" && accountNameInput.text !== "" && accountNameInput.valid && seedPhraseTextArea.correctWordCount
MessageDialog {
id: accountError

View File

@ -89,8 +89,13 @@ StatusModal {
//% "You need to enter an account name"
errorMessage: qsTrId("you-need-to-enter-an-account-name")
minLength: 1
},
StatusRegularExpressionValidator {
regularExpression: /^[^<>]+$/
errorMessage: qsTr("This is not a valid account name")
}
]
charLimit: 40
}
StatusColorSelectorGrid {
@ -114,7 +119,7 @@ StatusModal {
//% "Add account"
qsTrId("add-account")
enabled: !loading && addressInput.text !== "" && accountNameInput.text !== ""
enabled: !loading && addressInput.text !== "" && accountNameInput.text !== "" && accountNameInput.valid
MessageDialog {
id: accountError

View File

@ -104,8 +104,13 @@ StatusModal {
//% "You need to enter an account name"
errorMessage: qsTrId("you-need-to-enter-an-account-name")
minLength: 1
},
StatusRegularExpressionValidator {
regularExpression: /^[^<>]+$/
errorMessage: qsTr("This is not a valid account name")
}
]
charLimit: 40
}
StatusColorSelectorGrid {
@ -129,7 +134,7 @@ StatusModal {
//% "Add account"
qsTrId("add-account")
enabled: !loading && passwordInput.text !== "" && accountNameInput.text !== ""
enabled: !loading && passwordInput.text !== "" && accountNameInput.text !== "" && accountNameInput.valid
MessageDialog {
id: accountError