2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-02-01 13:29:26 +00:00

98_cmdalias.pm: match multiline (Forum #77285)

git-svn-id: https://svn.fhem.de/fhem/trunk@15154 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2017-09-30 12:23:26 +00:00
parent 61aefc1fc5
commit d0070671ab

View File

@ -80,11 +80,12 @@ CommandCmdAlias($$$)
return "Unknown command $a, internal error" if(!$a); return "Unknown command $a, internal error" if(!$a);
foreach my $n (sort keys %{$a->{Alias}}) { foreach my $n (sort keys %{$a->{Alias}}) {
my $h = $a->{Alias}{$n}; my $h = $a->{Alias}{$n};
if($h->{InExec} && $param =~ m/^$h->{PARAM}$/) { my $doesMatch = $param =~ m/^$h->{PARAM}$/s; # Match multiline, #77285
if($h->{InExec} && $doesMatch) {
Log3 $n, 3, "cmdalias $n called recursively, skipping execution"; Log3 $n, 3, "cmdalias $n called recursively, skipping execution";
next; next;
} }
if($param =~ m/^$h->{PARAM}$/) { if($doesMatch) {
my %specials= ("%EVENT" => $param); my %specials= ("%EVENT" => $param);
my $exec = EvalSpecials($h->{NEWCMD}, %specials); my $exec = EvalSpecials($h->{NEWCMD}, %specials);
$h->{InExec} = 1; $h->{InExec} = 1;