Merge branch '959-Masivas-de-plugins-no-funcionan' into 'develop'

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

See merge request !553
This commit is contained in:
vgilc 2017-06-06 09:50:14 +02:00
commit 164f70cb7d
2 changed files with 14 additions and 0 deletions

View File

@ -912,6 +912,10 @@ echo '</form>';
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);
} }
catch (err) { catch (err) {

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();
}