mirror of
https://github.com/nextcloud/android.git
synced 2024-11-21 20:55:31 +03:00
Merge pull request #13577 from nextcloud/file-name-validator-improvements
File Name Validator Improvements
This commit is contained in:
commit
b0fc628cb5
3 changed files with 16 additions and 9 deletions
|
@ -81,7 +81,7 @@ class FileNameValidatorTests : AbstractOnServerIT() {
|
|||
assertEquals(null, result2)
|
||||
} else {
|
||||
assertEquals(
|
||||
targetContext.getString(R.string.file_name_validator_error_forbidden_file_extensions, " "),
|
||||
targetContext.getString(R.string.file_name_validator_error_forbidden_space_character_extensions),
|
||||
result
|
||||
)
|
||||
assertEquals(
|
||||
|
|
|
@ -86,10 +86,16 @@ object FileNameValidator {
|
|||
forbiddenFilenameExtensionJson?.let {
|
||||
for (forbiddenExtension in forbiddenFilenameExtension()) {
|
||||
if (filename.endsWith(forbiddenExtension, ignoreCase = true)) {
|
||||
return context.getString(
|
||||
R.string.file_name_validator_error_forbidden_file_extensions,
|
||||
forbiddenExtension
|
||||
)
|
||||
return if (forbiddenExtension == StringConstants.SPACE) {
|
||||
context.getString(
|
||||
R.string.file_name_validator_error_forbidden_space_character_extensions
|
||||
)
|
||||
} else {
|
||||
context.getString(
|
||||
R.string.file_name_validator_error_forbidden_file_extensions,
|
||||
forbiddenExtension
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1235,13 +1235,14 @@
|
|||
<string name="unified_search_fragment_calendar_event_not_found">Event not found, you can always sync to update. Redirecting to web…</string>
|
||||
<string name="unified_search_fragment_contact_not_found">Contact not found, you can always sync to update. Redirecting to web…</string>
|
||||
<string name="unified_search_fragment_permission_needed">Permissions are required to open search result otherwise it will redirected to web…</string>
|
||||
<string name="file_name_validator_current_path_is_invalid">Current folder name is invalid, please rename the folder. Redirecting to root</string>
|
||||
<string name="file_name_validator_current_path_is_invalid">Current folder name is invalid, please rename the folder. Redirecting home…</string>
|
||||
<string name="file_name_validator_rename_before_move_or_copy">%s. Please rename the file before moving or copying</string>
|
||||
<string name="file_name_validator_upload_content_error">Some contents cannot able to uploaded due to contains reserved names or invalid character</string>
|
||||
<string name="file_name_validator_error_contains_reserved_names_or_invalid_characters">Folder path contains reserved names or invalid character</string>
|
||||
<string name="file_name_validator_error_invalid_character">Name contains an invalid character: %s</string>
|
||||
<string name="file_name_validator_upload_content_error">Some content cannot be uploaded since it contains reserved names or invalid characters</string>
|
||||
<string name="file_name_validator_error_contains_reserved_names_or_invalid_characters">Folder path contains reserved names or invalid characters</string>
|
||||
<string name="file_name_validator_error_invalid_character">Name contains invalid characters: %s</string>
|
||||
<string name="file_name_validator_error_reserved_names">%s is a forbidden name</string>
|
||||
<string name="file_name_validator_error_forbidden_file_extensions">%s is a forbidden file extension</string>
|
||||
<string name="file_name_validator_error_forbidden_space_character_extensions">Filenames must not contain spaces at the beginning or end</string>
|
||||
<string name="sync">Sync</string>
|
||||
<string name="please_select_a_server">Please select a server…</string>
|
||||
</resources>
|
||||
|
|
Loading…
Reference in a new issue