diff --git a/app/src/androidTest/java/com/nextcloud/utils/FileNameValidatorTests.kt b/app/src/androidTest/java/com/nextcloud/utils/FileNameValidatorTests.kt
index 881c96ae535d..7febed5c02ad 100644
--- a/app/src/androidTest/java/com/nextcloud/utils/FileNameValidatorTests.kt
+++ b/app/src/androidTest/java/com/nextcloud/utils/FileNameValidatorTests.kt
@@ -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(
diff --git a/app/src/main/java/com/nextcloud/utils/fileNameValidator/FileNameValidator.kt b/app/src/main/java/com/nextcloud/utils/fileNameValidator/FileNameValidator.kt
index ac738ce371a5..a7332da57660 100644
--- a/app/src/main/java/com/nextcloud/utils/fileNameValidator/FileNameValidator.kt
+++ b/app/src/main/java/com/nextcloud/utils/fileNameValidator/FileNameValidator.kt
@@ -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
+ )
+ }
}
}
}
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index cab13cb89017..5e4bb7f61a5c 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -1235,13 +1235,14 @@
Event not found, you can always sync to update. Redirecting to web…
Contact not found, you can always sync to update. Redirecting to web…
Permissions are required to open search result otherwise it will redirected to web…
- Current folder name is invalid, please rename the folder. Redirecting to root
+ Current folder name is invalid, please rename the folder. Redirecting home…
%s. Please rename the file before moving or copying
- Some contents cannot able to uploaded due to contains reserved names or invalid character
- Folder path contains reserved names or invalid character
- Name contains an invalid character: %s
+ Some content cannot be uploaded since it contains reserved names or invalid characters
+ Folder path contains reserved names or invalid characters
+ Name contains invalid characters: %s
%s is a forbidden name
%s is a forbidden file extension
+ Filenames must not contain spaces at the beginning or end
Sync
Please select a server…