1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-06-15 23:00:36 +02:00

All: Allow attaching files of unknown mime type

This commit is contained in:
Laurent Cozic
2017-12-01 23:15:49 +00:00
parent aef2e4845d
commit dbeff4fd7d
8 changed files with 29 additions and 67 deletions

View File

@ -35,4 +35,9 @@ function isHidden(path) {
return b[0] === '.';
}
module.exports = { basename, dirname, filename, isHidden, fileExtension };
function safeFileExtension(e) {
if (!e || !e.replace) return '';
return e.replace(/[^a-zA-Z0-9]/g, '')
}
module.exports = { basename, dirname, filename, isHidden, fileExtension, safeFileExtension };