Fixed determining file extension. (#6111)

This commit is contained in:
SamTV12345 2024-01-18 22:43:21 +01:00 committed by GitHub
parent 771e5c867e
commit 1a61994c61
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -114,7 +114,7 @@ const doImport = async (req, res, padId, authorId) => {
// ensure this is a file ending we know, else we change the file ending to .txt
// this allows us to accept source code files like .c or .java
const fileEnding = path.extname(srcFile).toLowerCase();
const fileEnding = path.extname(files.file[0].originalFilename).toLowerCase();
const knownFileEndings =
['.txt', '.doc', '.docx', '.pdf', '.odt', '.html', '.htm', '.etherpad', '.rtf'];
const fileEndingUnknown = (knownFileEndings.indexOf(fileEnding) < 0);