Decode html entities in module plugin selector for edit bulk operation - #959

This commit is contained in:
enriquecd 2017-06-05 12:50:22 +02:00
parent 291ae3a192
commit ced8050317
2 changed files with 14 additions and 0 deletions

View File

@ -911,6 +911,10 @@ echo '</form>';
try { try {
var agentsFiltered = agentsFilteredWithAgents(agents, ids); var agentsFiltered = agentsFilteredWithAgents(agents, ids);
var modules = moduleNamesFromAgents(agentsFiltered); var modules = moduleNamesFromAgents(agentsFiltered);
for (var i = 0; i < modules.length; i++) {
modules[i] = htmlDecode(modules[i]);
}
fillModules(modules, modulesSelected); fillModules(modules, modulesSelected);
} }

View File

@ -1184,3 +1184,13 @@ var autoHideElement = function (element, hideTime) {
// Start hide // Start hide
startHideTimeout(hideTime); startHideTimeout(hideTime);
} }
function htmlEncode(value){
// Create a in-memory div, set its 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();
}