TF-2517 Fix rename/create a folder with special characters do not show error message
This commit is contained in:
+15
@@ -0,0 +1,15 @@
|
||||
|
||||
extension MailboxNameSpecialCharacterValidatorExtension on String {
|
||||
bool get isValid {
|
||||
if (startsWith('#')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
final forbiddenChars = RegExp(r'[%*\r\n]');
|
||||
if (forbiddenChars.hasMatch(this)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
|
||||
extension NameValidatorStringExtension on String {
|
||||
bool hasSpecialCharactersInName() {
|
||||
return RegExp(r'(?=.*?[#?!@$%^&*)(=+}{:;?/|\\><.,`~])').hasMatch(this);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user