diff --git a/iOSClient/Extensions/UIAlertController+Extension.swift b/iOSClient/Extensions/UIAlertController+Extension.swift index 9c3d56d73e..719fbfecb0 100644 --- a/iOSClient/Extensions/UIAlertController+Extension.swift +++ b/iOSClient/Extensions/UIAlertController+Extension.swift @@ -216,7 +216,7 @@ extension UIAlertController { let oldExtension = fileName.fileExtension - let text = alertController.textFields?.first?.text ?? "" + let text = alertController.textFields?.first?.text?.trimmingCharacters(in: .whitespaces) ?? "" let textCheck = FileNameValidator.checkFileName(text, account: account, capabilities: capabilities) var message = textCheck?.error.localizedDescription ?? "" var messageColor = UIColor.red diff --git a/iOSClient/Supporting Files/en.lproj/Localizable.strings b/iOSClient/Supporting Files/en.lproj/Localizable.strings index 4537019ba2..d1720c3e75 100644 --- a/iOSClient/Supporting Files/en.lproj/Localizable.strings +++ b/iOSClient/Supporting Files/en.lproj/Localizable.strings @@ -703,6 +703,7 @@ You can stop it at any time, adjust the settings, and enable it again."; "_file_name_validator_error_invalid_character_" = "Name contains an invalid character: \"%@\"."; "_file_name_validator_error_space_" = "Name must not contain spaces at the beginning or end."; "_file_name_new_extension_" = "Changing the extension might cause this file to open in a different application."; +"_file_name_empty_" = "File name cannot be empty."; "_please_rename_file_" = "Please rename the file or folder."; "hidden_file_name_warning" = "Name will result in a hidden file.";