diff --git a/src/controllers/dashboard/plugins/add/index.js b/src/controllers/dashboard/plugins/add/index.js index 1039771a0d..1cd4e0d3c5 100644 --- a/src/controllers/dashboard/plugins/add/index.js +++ b/src/controllers/dashboard/plugins/add/index.js @@ -53,24 +53,24 @@ function renderPackage(pkg, installedPlugins, page) { populateVersions(pkg, page, installedPlugin); populateHistory(pkg, page); - $('.pluginName', page).html(pkg.name); + $('.pluginName', page).text(pkg.name); $('#btnInstallDiv', page).removeClass('hide'); $('#pSelectVersion', page).removeClass('hide'); if (pkg.overview) { - $('#overview', page).show().html(pkg.overview); + $('#overview', page).show().text(pkg.overview); } else { $('#overview', page).hide(); } - $('#description', page).html(pkg.description); - $('#developer', page).html(pkg.owner); + $('#description', page).text(pkg.description); + $('#developer', page).text(pkg.owner); if (installedPlugin) { const currentVersionText = globalize.translate('MessageYouHaveVersionInstalled', '' + installedPlugin.Version + ''); - $('#pCurrentVersion', page).show().html(currentVersionText); + $('#pCurrentVersion', page).show().text(currentVersionText); } else { - $('#pCurrentVersion', page).hide().html(''); + $('#pCurrentVersion', page).hide().text(''); } loading.hide(); diff --git a/src/controllers/dashboard/plugins/available/index.js b/src/controllers/dashboard/plugins/available/index.js index e24d4a144f..656d5bf321 100644 --- a/src/controllers/dashboard/plugins/available/index.js +++ b/src/controllers/dashboard/plugins/available/index.js @@ -1,3 +1,5 @@ +import escapeHTML from 'escape-html'; + import loading from '../../../../components/loading/loading'; import libraryMenu from '../../../../scripts/libraryMenu'; import globalize from '../../../../scripts/globalize'; @@ -73,7 +75,7 @@ function populateList(options) { html += ''; } html += '
'; - html += '

' + category + '

'; + html += '

' + escapeHTML(category) + '

'; html += '
'; currentCategory = category; } @@ -107,7 +109,7 @@ function getPluginHtml(plugin, options, installedPlugins) { html += ``; if (plugin.imageUrl) { - html += ``; + html += ``; } else { html += `
`; html += ''; @@ -119,11 +121,9 @@ function getPluginHtml(plugin, options, installedPlugins) { html += '
'; html += '
'; html += "
"; - html += plugin.name; + html += escapeHTML(plugin.name); html += '
'; - const installedPlugin = installedPlugins.filter(function (ip) { - return ip.Id == plugin.guid; - })[0]; + const installedPlugin = installedPlugins.find(installed => installed.Id === plugin.guid); html += "
"; html += installedPlugin ? globalize.translate('LabelVersionInstalled', installedPlugin.Version) : ' '; html += '
';