From 5800a45c22db972474166d3eba4087711e3969a5 Mon Sep 17 00:00:00 2001 From: alperozturk Date: Wed, 3 Jul 2024 12:37:03 +0200 Subject: [PATCH] Add forbiddenFilenameCharacterList values coming from server Signed-off-by: alperozturk --- .../nextcloud/utils/fileNameValidator/FileNameValidator.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 0cb7a88f6f..e2ff97618b 100644 --- a/app/src/main/java/com/nextcloud/utils/fileNameValidator/FileNameValidator.kt +++ b/app/src/main/java/com/nextcloud/utils/fileNameValidator/FileNameValidator.kt @@ -44,7 +44,9 @@ object FileNameValidator { if (capability.forbiddenFilenameCharacters.isTrue) { val invalidCharacter = name.find { - it.toString().matches(reservedWindowsChars) || it.toString().matches(reservedUnixChars) + it.toString().matches(reservedWindowsChars) || + it.toString().matches(reservedUnixChars) || + capability.forbiddenFilenameCharacterList.contains(it.toString()) } if (invalidCharacter != null) { return context.getString(R.string.file_name_validator_error_invalid_character, invalidCharacter)