Skip to content

Commit

Permalink
- Fix for #102 (comment)
Browse files Browse the repository at this point in the history
  • Loading branch information
Pablo Carrascal committed Aug 10, 2018
1 parent 5d5cdc7 commit 4299806
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
11 changes: 9 additions & 2 deletions ownCloud/Client/Actions/RenameViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,15 @@ class RenameViewController: UIViewController {
}

@objc private func doneButtonPressed() {
self.dismiss(animated: true) {
self.completion(self.nameTextField.text!)
if nameTextField.text!.contains("/") || nameTextField.text!.contains("\\") {
let controller = UIAlertController(title: "Forbiden Characters".localized, message: "File name cannot contain / or \\".localized, preferredStyle: .alert)
let okAction = UIAlertAction(title: "Ok", style: .default)
controller.addAction(okAction)
self.present(controller, animated: true)
} else {
self.dismiss(animated: true) {
self.completion(self.nameTextField.text!)
}
}
}
}
Expand Down
5 changes: 5 additions & 0 deletions ownCloud/Resources/en.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -130,3 +130,8 @@
"Please try again in %@" = "Please try again in %@";
"Unlock %@" = "Unlock %@";
"Biometric authentication failed" = "Biometric authentication failed";

/* Rename Messages */

"Forbiden Characters" = "Forbiden Characters";
"File name cannot contain / or \\" = "File name cannot contain / or \\";

0 comments on commit 4299806

Please sign in to comment.