mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-16 04:36:02 +00:00
fhem.pl: devspec2array: revert from \b$re\b to ^$re$ for non-room queries
git-svn-id: https://svn.fhem.de/fhem/trunk@4709 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
c804978179
commit
2ee21077b6
13
fhem/fhem.pl
13
fhem/fhem.pl
@ -885,6 +885,12 @@ devspec2array($)
|
||||
|
||||
my (@ret, $isAttr);
|
||||
foreach my $l (split(",", $name)) { # List of elements
|
||||
|
||||
if(defined($defs{$l})) {
|
||||
push @ret, $l;
|
||||
next;
|
||||
}
|
||||
|
||||
my @names = sort keys %defs;
|
||||
my @res;
|
||||
foreach my $dName (split(":FILTER=", $l)) {
|
||||
@ -915,12 +921,15 @@ devspec2array($)
|
||||
$val = $attr{$d}{$n} if($attr{$d});
|
||||
}
|
||||
$val="" if(!defined($val));
|
||||
|
||||
my $lre = ($n eq "room" ? "\\b$re\\b" : "^$re\$");
|
||||
eval { # a bad regexp is deadly
|
||||
if(($op eq "=" && $val =~ m/\b$re\b/) ||
|
||||
($op eq "!=" && $val !~ m/\b$re\b/)) {
|
||||
if(($op eq "=" && $val =~ m/$lre/) ||
|
||||
($op eq "!=" && $val !~ m/$lre/)) {
|
||||
push @res, $d
|
||||
}
|
||||
};
|
||||
|
||||
if($@) {
|
||||
Log 1, "devspec2array $name: $@";
|
||||
return $name;
|
||||
|
Loading…
x
Reference in New Issue
Block a user