mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-05-03 13:45:36 +00:00
01_FHEMWEB.pm: avoid crash due to evaluated devStateIcon (Forum #132483)
git-svn-id: https://svn.fhem.de/fhem/trunk@27294 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
c67b5a7a33
commit
773a3621d6
@ -3038,6 +3038,16 @@ FW_dev2image($;$)
|
|||||||
Log3 $FW_wname, 1, "devStateIcon $name: $@" if($@);
|
Log3 $FW_wname, 1, "devStateIcon $name: $@" if($@);
|
||||||
return ($html, $link, 1) if(defined($html) && $html =~ m/^<.*>$/s);
|
return ($html, $link, 1) if(defined($html) && $html =~ m/^<.*>$/s);
|
||||||
$devStateIcon = $html;
|
$devStateIcon = $html;
|
||||||
|
if($devStateIcon) { # 132483
|
||||||
|
foreach my $l (split(" ", $devStateIcon)) {
|
||||||
|
my ($re, $iconName, $link) = split(":", $l, 3);
|
||||||
|
eval { "Hallo" =~ m/^$re$/ };
|
||||||
|
if($@) {
|
||||||
|
Log 1, "ERROR: $name devStateIcon evaluated to $devStateIcon => $@";
|
||||||
|
return "ERROR, check the log";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(defined($devStateIcon)) {
|
if(defined($devStateIcon)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user