Escape file titles in recovery page
This commit is contained in:
parent
d9b3b95f46
commit
81db48c1a9
@ -42,6 +42,21 @@
|
||||
elt.className = elt.className.replace(/ hide/, '');
|
||||
}
|
||||
|
||||
var entityMap = {
|
||||
"&": "&",
|
||||
"<": "<",
|
||||
">": ">",
|
||||
'"': '"',
|
||||
"'": ''',
|
||||
"/": '/'
|
||||
};
|
||||
|
||||
function escapeHtml(string) {
|
||||
return String(string).replace(/[&<>"'\/]/g, function(s) {
|
||||
return entityMap[s];
|
||||
});
|
||||
}
|
||||
|
||||
function listFiles() {
|
||||
// List files
|
||||
var fileListElt = document.querySelector('.file-list');
|
||||
@ -56,7 +71,7 @@
|
||||
'<a href="javascript:removeFile(\'',
|
||||
fileIndex,
|
||||
'\')" class="icon-trash"></a> ',
|
||||
fileTitle,
|
||||
escapeHtml(fileTitle),
|
||||
].join('');
|
||||
fileListElt.appendChild(divElt);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user