sanitize note title && attrs just to be sure

This commit is contained in:
zadam
2022-07-06 23:09:16 +02:00
parent 4fc686bbbc
commit 12b3302687
6 changed files with 24 additions and 2 deletions

View File

@@ -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');
}