Skip to content

Commit 737efdf

Browse files
committed
MOBILE-1701 fs: Fix rename local files in Android
1 parent f749d29 commit 737efdf

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

www/core/lib/fs.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1185,6 +1185,9 @@ angular.module('mm.core')
11851185
newName,
11861186
number = 1;
11871187

1188+
// Clean the file name.
1189+
fileNameWithoutExtension = $mmText.removeSpecialCharactersForFiles(decodeURIComponent(fileNameWithoutExtension));
1190+
11881191
// Index the files by name.
11891192
angular.forEach(entries, function(entry) {
11901193
files[entry.name] = entry;
@@ -1212,8 +1215,8 @@ angular.module('mm.core')
12121215
return newName;
12131216
}
12141217
}).catch(function() {
1215-
// Folder doesn't exist, name is unique.
1216-
return fileName;
1218+
// Folder doesn't exist, name is unique. Clean it and return it.
1219+
return $mmText.removeSpecialCharactersForFiles(decodeURIComponent(fileName));
12171220
});
12181221
};
12191222

0 commit comments

Comments
 (0)