00_MQTT2_SERVER.pm: Fix # matching for Topics starting with /

git-svn-id: https://svn.fhem.de/fhem/trunk@20131 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig
2019-09-08 10:17:37 +00:00
parent f327b30517
commit b080e287a4

View File

@@ -451,6 +451,7 @@ MQTT2_SERVER_sendto($$$$)
$val = "" if(!defined($val)); $val = "" if(!defined($val));
foreach my $s (keys %{$hash->{subscriptions}}) { foreach my $s (keys %{$hash->{subscriptions}}) {
my $re = $s; my $re = $s;
$re =~ s,^#$,.*,g;
$re =~ s,/?#,\\b.*,g; $re =~ s,/?#,\\b.*,g;
$re =~ s,\+,\\b[^/]+\\b,g; $re =~ s,\+,\\b[^/]+\\b,g;
if($topic =~ m/^$re$/) { if($topic =~ m/^$re$/) {