diff --git a/fhem/www/pgm2/fhemweb.js b/fhem/www/pgm2/fhemweb.js index 8eaeb196d..084e042cb 100644 --- a/fhem/www/pgm2/fhemweb.js +++ b/fhem/www/pgm2/fhemweb.js @@ -600,6 +600,14 @@ FW_replaceLink(el) $(el).css("cursor", "pointer"); } +function +FW_htmlQuote(text) +{ + return text.replace(/&/g, '&') // Same as in 01_FHEMWEB + .replace(//g, '>'); +} + function FW_inlineModify() // Do not generate a new HTML page upon pressing modify { @@ -655,16 +663,16 @@ FW_inlineModify() // Do not generate a new HTML page upon pressing modify FW_cmd(FW_root+"?"+encodeURIComponent(cmd)+"&XHR=1", function(resp){ if(resp) { + resp = FW_htmlQuote(resp); if(resp.indexOf("\n") >= 0) resp = '
'+resp+''; return FW_okDialog(resp); } - newDef = newDef.replace(/&/g, '&') // Same as in 01_FHEMWEB - .replace(//g, '>'); if(isDef) { if(newDef.indexOf("\n") >= 0) newDef = '
'+newDef+''; + else + newDef = FW_htmlQuote(newDef); $("div#disp").html(newDef).css("display", ""); $("div#edit").css("display", "none"); }