diff --git a/resources/dist/index.js b/resources/dist/index.js index 099be1e7a..c60d55408 100644 Binary files a/resources/dist/index.js and b/resources/dist/index.js differ diff --git a/resources/dist/index.js.map.json b/resources/dist/index.js.map.json index 5bd2f38b2..691dd833d 100644 Binary files a/resources/dist/index.js.map.json and b/resources/dist/index.js.map.json differ diff --git a/src/ui/templates/pagePreview/pagePreview.js b/src/ui/templates/pagePreview/pagePreview.js index ab75f3f8a..8baf68fd8 100644 --- a/src/ui/templates/pagePreview/pagePreview.js +++ b/src/ui/templates/pagePreview/pagePreview.js @@ -3,6 +3,7 @@ */ import { renderPopup } from '../popup/popup'; +import { escapeHTML } from '../templateUtil'; /** * @param {ext.popups.PreviewModel} model @@ -10,9 +11,13 @@ import { renderPopup } from '../popup/popup'; * @return {string} HTML string. */ export function renderPagePreview( - { url, type, languageCode, languageDirection }, hasThumbnail + model, hasThumbnail ) { - return renderPopup( type, + const url = escapeHTML( model.url ), + languageCode = escapeHTML( model.languageCode ), + languageDirection = escapeHTML( model.languageDirection ); + + return renderPopup( model.type, ` ${ hasThumbnail ? `` : '' } diff --git a/src/ui/templates/popup/popup.js b/src/ui/templates/popup/popup.js index 889f68909..d8dd20691 100644 --- a/src/ui/templates/popup/popup.js +++ b/src/ui/templates/popup/popup.js @@ -2,12 +2,16 @@ * @module popup */ +import { escapeHTML } from '../templateUtil'; + /** * @param {ext.popups.previewTypes} type * @param {string} html HTML string. * @return {string} HTML string. */ export function renderPopup( type, html ) { + type = escapeHTML( type ); + return `