mirror of
https://github.com/zadam/trilium.git
synced 2025-11-02 19:36:12 +01:00
sanitize note title && attrs just to be sure
This commit is contained in:
@@ -43,7 +43,7 @@ function getClipperInboxNote() {
|
||||
}
|
||||
|
||||
function addClipping(req) {
|
||||
const {title, content, pageUrl, images} = req.body;
|
||||
let {title, content, pageUrl, images} = req.body;
|
||||
|
||||
const clipperInbox = getClipperInboxNote();
|
||||
|
||||
@@ -57,6 +57,8 @@ function addClipping(req) {
|
||||
type: 'text'
|
||||
}).note;
|
||||
|
||||
pageUrl = htmlSanitizer.sanitize(pageUrl);
|
||||
|
||||
clippingNote.setLabel('clipType', 'clippings');
|
||||
clippingNote.setLabel('pageUrl', pageUrl);
|
||||
clippingNote.setLabel('iconClass', 'bx bx-globe');
|
||||
@@ -89,9 +91,13 @@ function createNote(req) {
|
||||
type: 'text'
|
||||
});
|
||||
|
||||
clipType = htmlSanitizer.sanitize(clipType);
|
||||
|
||||
note.setLabel('clipType', clipType);
|
||||
|
||||
if (pageUrl) {
|
||||
pageUrl = htmlSanitizer.sanitize(pageUrl);
|
||||
|
||||
note.setLabel('pageUrl', pageUrl);
|
||||
note.setLabel('iconClass', 'bx bx-globe');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user