mirror of
https://github.com/wekan/wekan.git
synced 2025-12-25 19:58:49 +01:00
Attachment, path was wrong if the file hasn't a extension
This commit is contained in:
parent
6a20f6dc70
commit
25443926d3
1 changed files with 6 additions and 1 deletions
|
|
@ -59,7 +59,12 @@ Attachments = new FilesCollection({
|
|||
delete opts.meta.fileId;
|
||||
} else if (opts?.file?.name) {
|
||||
// Server
|
||||
filenameWithoutExtension = opts.file.name.replace(new RegExp(opts.file.extensionWithDot + "$"), "")
|
||||
if (opts.file.extension) {
|
||||
filenameWithoutExtension = opts.file.name.replace(new RegExp(opts.file.extensionWithDot + "$"), "")
|
||||
} else {
|
||||
// file has no extension, so don't replace anything, otherwise the last character is removed (because extensionWithDot = '.')
|
||||
filenameWithoutExtension = opts.file.name;
|
||||
}
|
||||
fileId = opts.fileId;
|
||||
}
|
||||
else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue