2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-03 04:36:36 +00:00

96_allowed.pm: avoid crash when entering strange commands (Forum #74076)

git-svn-id: https://svn.fhem.de/fhem/trunk@14681 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2017-07-09 18:32:41 +00:00
parent 01d8c218b6
commit 4ec69191fd

View File

@ -77,14 +77,15 @@ allowed_Authorize($$$$)
if($type eq "cmd") {
return 0 if(!$me->{allowedCommands});
# Return 0: allow stacking with other instances, see Forum#46380
return ($me->{allowedCommands} =~ m/\b$arg\b/) ? 0 : 2;
return ($me->{allowedCommands} =~ m/\b\Q$arg\E\b/) ? 0 : 2;
}
if($type eq "devicename") {
return 0 if(!$me->{allowedDevices});
return ($me->{allowedDevices} =~ m/\b$arg\b/) ? 0 : 2;
return ($me->{allowedDevices} =~ m/\b\Q$arg\E\b/) ? 0 : 2;
}
return 0;
}