2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-10 09:16:53 +00:00

AttrTemplate.pm: add \ escape for variable substitution (Forum #97989)

git-svn-id: https://svn.fhem.de/fhem/trunk@18990 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2019-03-22 09:06:48 +00:00
parent e263f7f84d
commit 6c953a0c46

View File

@ -172,7 +172,8 @@ AttrTemplate_Set($$@)
my $cmdlist = join("\n",@{$h->{cmds}});
$repl{DEVICE} = $name;
map { $cmdlist =~ s/$_/$repl{$_}/g; } keys %repl;
map { $cmdlist =~ s/(?<!\\)$_/$repl{$_}/g; } keys %repl;
map { $cmdlist =~ s/\\$_/$_/g; } keys %repl;
my $cmd = "";
my @ret;
map {