mirror of
https://github.com/humhub/humhub.git
synced 2025-04-15 12:47:22 +02:00
Fixed: Html encode file upload errors
This commit is contained in:
parent
270b8b4516
commit
c4a8cbbb78
10
js/app.js
10
js/app.js
@ -324,7 +324,15 @@ $.fn.format = function (options) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
function htmlEncode(value) {
|
||||
//create a in-memory div, set it's inner text(which jQuery automatically encodes)
|
||||
//then grab the encoded contents back out. The div never exists on the page.
|
||||
return $('<div/>').text(value).html();
|
||||
}
|
||||
|
||||
function htmlDecode(value) {
|
||||
return $('<div/>').html(value).text();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -85,7 +85,7 @@ function showFileUploadError(file) {
|
||||
'<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>' +
|
||||
'<h4 class="modal-title" id="myModalLabel">' + fileuploader_error_modal_title + '</h4> ' +
|
||||
'</div>' +
|
||||
'<div class="modal-body text-center">' + fileuploader_error_modal_errormsg + ' ' + file.name + '<br>' + errorMessage + '</div>' +
|
||||
'<div class="modal-body text-center">' + fileuploader_error_modal_errormsg + ' ' + htmlEncode(file.name) + '<br>' + htmlEncode(errorMessage) + '</div>' +
|
||||
'<div class="modal-footer">' +
|
||||
'<button type="button" class="btn btn-primary" data-dismiss="modal">' + fileuploader_error_modal_btn_close + '</button>' +
|
||||
'</div>' +
|
||||
|
Loading…
x
Reference in New Issue
Block a user