@@ -78,7 +78,7 @@ export function validateFilename(filename: string): void {
7878
7979 // Handle forbidden characters
8080 // This needs to be done first as the other checks are case insensitive!
81- const forbiddenCharacters = capabilities . forbidden_filename_characters ?? window . _oc_config ?. forbidden_filenames_characters ?? [ '/' , '\\' ]
81+ const forbiddenCharacters = capabilities . forbidden_filename_characters ?? [ '/' , '\\' ]
8282 for ( const character of forbiddenCharacters ) {
8383 if ( filename . includes ( character ) ) {
8484 throw new InvalidFilenameError ( { segment : character , reason : InvalidFilenameErrorReason . Character , filename } )
@@ -102,9 +102,7 @@ export function validateFilename(filename: string): void {
102102 throw new InvalidFilenameError ( { filename, segment : basename , reason : InvalidFilenameErrorReason . ReservedName } )
103103 }
104104
105- // The legacy 'blacklist_files_regex' was hardcoded to the extension '.part' and '.filepart'
106- // So if the new (Nextcloud 30) capability is not awailable then we fallback to that
107- const forbiddenFilenameExtensions = capabilities . forbidden_filename_extensions ?? [ '.part' , '.filepart' ]
105+ const forbiddenFilenameExtensions = capabilities . forbidden_filename_extensions ?? [ ]
108106 for ( const extension of forbiddenFilenameExtensions ) {
109107 if ( filename . length > extension . length && filename . endsWith ( extension ) ) {
110108 throw new InvalidFilenameError ( { segment : extension , reason : InvalidFilenameErrorReason . Extension , filename } )
@@ -114,7 +112,7 @@ export function validateFilename(filename: string): void {
114112
115113/**
116114 * Check the validity of a filename
117- * This is a convinient wrapper for `checkFilenameValidity` to only return a boolean for the valid
115+ * This is a convenient wrapper for `checkFilenameValidity` to only return a boolean for the valid
118116 * @param filename Filename to check validity
119117 */
120118export function isFilenameValid ( filename : string ) : boolean {
0 commit comments