improve the basis name validator - ':' is an illegal character in a basis name.

This commit is contained in:
bunnie 2022-07-26 00:05:45 +08:00
parent ec5cc29ccd
commit 494ec7c2b3
3 changed files with 5 additions and 5 deletions

View file

@ -198,10 +198,10 @@
"en-tts": "Symbols"
},
"vault.illegal_char": {
"en": "Entries may not contain a newline character.",
"ja": "エントリに改行文字を含めることはできません。",
"zh": "条目可能不包含换行符。",
"en-tts": "Entries may not contain a newline character."
"en": "Entries may not contain ':', or a newline character.",
"ja": "エントリに「:」または改行文字を含めることはできません。",
"zh": "条目不得包含 ':' 或换行符。",
"en-tts": "Entries may not contain ':', or a newline character."
},
"vault.illegal_number": {
"en": "Please enter a number from 1-128",

View file

@ -1293,7 +1293,7 @@ pub(crate) fn totp_ss_validator(input: TextEntryPayload) -> Option<xous_ipc::Str
}
pub(crate) fn name_validator(input: TextEntryPayload) -> Option<xous_ipc::String<256>> {
let proposed_name = input.as_str();
if proposed_name.contains('\n') { // the '\n' is reserved as the delimiter to end the name field
if proposed_name.contains(['\n',':']) { // the '\n' is reserved as the delimiter to end the name field, and ':' is the path separator
Some(xous_ipc::String::<256>::from_str(t!("vault.illegal_char", xous::LANG)))
} else {
None