mirror of
https://github.com/zadam/trilium.git
synced 2025-11-01 02:45:54 +01:00
sanitize note title
This commit is contained in:
@@ -341,8 +341,10 @@ function downloadImages(noteId, content) {
|
||||
const imageService = require('../services/image');
|
||||
const {note} = imageService.saveImage(noteId, imageBuffer, "inline image", true, true);
|
||||
|
||||
const sanitizedTitle = note.title.replace(/[^a-z0-9-.]/gi, "");
|
||||
|
||||
content = content.substr(0, imageMatch.index)
|
||||
+ `<img src="api/images/${note.noteId}/${note.title}"`
|
||||
+ `<img src="api/images/${note.noteId}/${sanitizedTitle}"`
|
||||
+ content.substr(imageMatch.index + imageMatch[0].length);
|
||||
}
|
||||
else if (!url.includes('api/images/')
|
||||
|
||||
Reference in New Issue
Block a user