fhemweb.js: quote returned <> from modify (Forum #69138)
git-svn-id: https://svn.fhem.de/fhem/trunk@13722 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
@@ -600,6 +600,14 @@ FW_replaceLink(el)
|
|||||||
$(el).css("cursor", "pointer");
|
$(el).css("cursor", "pointer");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function
|
||||||
|
FW_htmlQuote(text)
|
||||||
|
{
|
||||||
|
return text.replace(/&/g, '&') // Same as in 01_FHEMWEB
|
||||||
|
.replace(/</g, '<')
|
||||||
|
.replace(/>/g, '>');
|
||||||
|
}
|
||||||
|
|
||||||
function
|
function
|
||||||
FW_inlineModify() // Do not generate a new HTML page upon pressing modify
|
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){
|
FW_cmd(FW_root+"?"+encodeURIComponent(cmd)+"&XHR=1", function(resp){
|
||||||
if(resp) {
|
if(resp) {
|
||||||
|
resp = FW_htmlQuote(resp);
|
||||||
if(resp.indexOf("\n") >= 0)
|
if(resp.indexOf("\n") >= 0)
|
||||||
resp = '<pre>'+resp+'</pre>';
|
resp = '<pre>'+resp+'</pre>';
|
||||||
return FW_okDialog(resp);
|
return FW_okDialog(resp);
|
||||||
}
|
}
|
||||||
newDef = newDef.replace(/&/g, '&') // Same as in 01_FHEMWEB
|
|
||||||
.replace(/</g, '<')
|
|
||||||
.replace(/>/g, '>');
|
|
||||||
if(isDef) {
|
if(isDef) {
|
||||||
if(newDef.indexOf("\n") >= 0)
|
if(newDef.indexOf("\n") >= 0)
|
||||||
newDef = '<pre>'+newDef+'</pre>';
|
newDef = '<pre>'+newDef+'</pre>';
|
||||||
|
else
|
||||||
|
newDef = FW_htmlQuote(newDef);
|
||||||
$("div#disp").html(newDef).css("display", "");
|
$("div#disp").html(newDef).css("display", "");
|
||||||
$("div#edit").css("display", "none");
|
$("div#edit").css("display", "none");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user