mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-01-31 19:02:59 +01:00
pad_impexp: Use jQuery to build the import failure popup
This reduces the chances of accidentally introducing an XSS vulnerability.
This commit is contained in:
parent
d869d96a2b
commit
cc52811cd0
1 changed files with 6 additions and 3 deletions
|
@ -84,9 +84,12 @@ const padimpexp = (() => {
|
||||||
const msg = html10n.get(`pad.impexp.${known.indexOf(status) !== -1 ? status : 'copypaste'}`);
|
const msg = html10n.get(`pad.impexp.${known.indexOf(status) !== -1 ? status : 'copypaste'}`);
|
||||||
|
|
||||||
const showError = (fade) => {
|
const showError = (fade) => {
|
||||||
$('#importmessagefail').html(
|
const popup = $('#importmessagefail').empty()
|
||||||
`<strong style="color: red">${html10n.get('pad.impexp.importfailed')}:</strong> ` +
|
.append($('<strong>')
|
||||||
`${msg}`)[(fade ? 'fadeIn' : 'show')]();
|
.css('color', 'red')
|
||||||
|
.text(`${html10n.get('pad.impexp.importfailed')}: `))
|
||||||
|
.append(document.createTextNode(msg));
|
||||||
|
popup[(fade ? 'fadeIn' : 'show')]();
|
||||||
};
|
};
|
||||||
|
|
||||||
if ($('#importexport .importmessage').is(':visible')) {
|
if ($('#importexport .importmessage').is(':visible')) {
|
||||||
|
|
Loading…
Reference in a new issue