2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 18:59:33 +00:00

Display attributes with <> in their value

git-svn-id: https://svn.fhem.de/fhem/trunk@2453 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2013-01-08 09:27:37 +00:00
parent cc06ee5fdc
commit 81c42fdb2c

View File

@ -18,6 +18,7 @@ sub FW_doDetail($);
sub FW_dumpFileLog($$$);
sub FW_fatal($);
sub FW_fileList($);
sub FW_htmlEscape($);
sub FW_logWrapper($);
sub FW_makeEdit($$$);
sub FW_makeImage($);
@ -601,7 +602,7 @@ FW_answerCall($)
if($FW_cmdret) {
$FW_detail = "";
$FW_room = "";
$FW_cmdret =~ s/</&lt;/g;
$FW_cmdret = FW_htmlEscape($FW_cmdret);
$FW_cmdret =~ s/>/&gt;/g;
FW_pO "<div id=\"content\">";
$FW_cmdret = "<pre>$FW_cmdret</pre>" if($FW_cmdret =~ m/\n/);
@ -738,6 +739,7 @@ FW_makeTable($$@)
FW_pO "<td><div class=\"dname\">$n</div></td>";
if(ref($val)) {
my ($v, $t) = ($val->{VAL}, $val->{TIME});
$v = FW_htmlEscape($v);
if($FW_ss) {
$t = ($t ? "<br><div class=\"tiny\">$t</div>" : "");
FW_pO "<td><div class=\"dval\">$v$t</div></td>";
@ -749,6 +751,7 @@ FW_makeTable($$@)
}
} else {
$val = FW_htmlEscape($val);
FW_pO "<td><div class=\"dval\">$val</div></td>";
}
@ -1346,8 +1349,7 @@ FW_logWrapper($)
}
my $cnt = join("", reverse <FH>);
close(FH);
$cnt =~ s/</&lt;/g;
$cnt =~ s/>/&gt;/g;
$cnt = FW_htmlEscape($cnt);
FW_pO $cnt;
FW_pO $suffix;
@ -2646,6 +2648,15 @@ FW_closeOldClients()
InternalTimer($now+60, "FW_closeOldClients", 0, 0);
}
sub
FW_htmlEscape($)
{
my ($txt) = @_;
$txt =~ s/</&lt;/g;
$txt =~ s/>/&gt;/g;
return $txt;
}
1;
=pod