mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-13 17:26:34 +00:00
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:
parent
d298be4d89
commit
a1fabe668a
@ -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, '<')
|
||||
.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 = '<pre>'+resp+'</pre>';
|
||||
return FW_okDialog(resp);
|
||||
}
|
||||
newDef = newDef.replace(/&/g, '&') // Same as in 01_FHEMWEB
|
||||
.replace(/</g, '<')
|
||||
.replace(/>/g, '>');
|
||||
if(isDef) {
|
||||
if(newDef.indexOf("\n") >= 0)
|
||||
newDef = '<pre>'+newDef+'</pre>';
|
||||
else
|
||||
newDef = FW_htmlQuote(newDef);
|
||||
$("div#disp").html(newDef).css("display", "");
|
||||
$("div#edit").css("display", "none");
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user