You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-11-26 22:41:17 +02:00
Desktop, Cli: Fixes #9548: Import ENEX archives that contain files with invalid names
This commit is contained in:
@@ -9,7 +9,7 @@ import shim from './shim';
|
||||
import { NoteEntity, ResourceEntity } from './services/database/types';
|
||||
import { enexXmlToMd } from './import-enex-md-gen';
|
||||
import { MarkupToHtml } from '@joplin/renderer';
|
||||
import { fileExtension, friendlySafeFilename } from './path-utils';
|
||||
import { fileExtension, friendlySafeFilename, safeFileExtension } from './path-utils';
|
||||
const moment = require('moment');
|
||||
const { wrapError } = require('./errorUtils');
|
||||
const { enexXmlToHtml } = require('./import-enex-html-gen.js');
|
||||
@@ -208,7 +208,7 @@ async function saveNoteResources(note: ExtractedNote) {
|
||||
delete (toSave as any).dataFilePath;
|
||||
delete (toSave as any).dataEncoding;
|
||||
delete (toSave as any).hasData;
|
||||
toSave.file_extension = resource.filename ? fileExtension(resource.filename) : '';
|
||||
toSave.file_extension = resource.filename ? safeFileExtension(fileExtension(resource.filename)) : '';
|
||||
|
||||
// ENEX resource filenames can contain slashes, which may confuse other
|
||||
// parts of the app, which expect this `filename` field to be safe.
|
||||
|
||||
Reference in New Issue
Block a user