0
0
mirror of https://github.com/wagtail/wagtail.git synced 2024-11-29 17:36:49 +01:00

Merge pull request #1299 from veryhappythings/fix-image-filenames

Fix image filenames
This commit is contained in:
Dave Cranwell 2015-05-14 11:30:41 +01:00
commit 13e8c5b04b
2 changed files with 15 additions and 1 deletions

View File

@ -7,6 +7,20 @@ function addMessage(status, text) {
}, 100);
}
function escapeHtml(text) {
var map = {
'&': '&',
'<': '&lt;',
'>': '&gt;',
'"': '&quot;',
'\'': '&#039;'
};
return text.replace(/[&<>"']/g, function(m) {
return map[m];
});
}
$(function() {
// Add class to the body from which transitions may be hung so they don't appear to transition as the page loads
$('body').addClass('ready');

View File

@ -38,7 +38,7 @@ $(function() {
}).always(function() {
data.context.removeClass('processing');
data.context.find('.left').each(function(index, elm) {
$(elm).append(data.files[index].name);
$(elm).append(escapeHtml(data.files[index].name));
});
data.context.find('.preview .thumb').each(function(index, elm) {