From 6d09c7030e847bc1d49751f5dd7e5ec81cf9421d Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Tue, 29 Sep 2009 19:50:59 +0000 Subject: [PATCH] 2009-09-29 Miguel de Dios * include/javascript/pandora_mod, include/javascript/pandora.js: cleanup the sourcecode and add more funcionality to funciton "html_entity_decode". git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1990 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/include/javascript/pandora.js | 5 ++++- pandora_console/include/javascript/pandora_modules.js | 4 +--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/pandora_console/include/javascript/pandora.js b/pandora_console/include/javascript/pandora.js index b47ddd60f6..d694ddcb12 100644 --- a/pandora_console/include/javascript/pandora.js +++ b/pandora_console/include/javascript/pandora.js @@ -30,7 +30,10 @@ function html_entity_decode (str) { if (! str) return ""; var ta = document.createElement ("textarea"); - ta.innerHTML = str.replace (//g,">"); + ta.innerHTML = str.replace (//g,">").replace(/</g,'<').replace(/>/g,'>') + .replace(/\/g,'\\').replace(/"/g,'\"').replace(/'/g,'\'') + .replace(/&/g,'&'); return ta.value; } diff --git a/pandora_console/include/javascript/pandora_modules.js b/pandora_console/include/javascript/pandora_modules.js index 50e7512f76..809b4c2d75 100644 --- a/pandora_console/include/javascript/pandora_modules.js +++ b/pandora_console/include/javascript/pandora_modules.js @@ -68,9 +68,7 @@ function configure_modules_form () { "id_module_component" : this.value }, function (data, status) { - configuration_data = data['data'] - .replace(/</g,'<').replace(/>/g,'>') - .replace(/\/g,'\\').replace(/"/g,'\"').replace(/'/g,'\'').replace(/&/g,'&'); + configuration_data = html_entity_decode (data['data']); $("#text-name").attr ("value", html_entity_decode (data["name"])); $("#textarea_description").attr ("value", html_entity_decode (data["description"]));