From 3f7eeb33ef7693b2d71aa07d63fe910b8f2f8688 Mon Sep 17 00:00:00 2001 From: rudolfkoenig <> Date: Wed, 30 Jan 2019 21:38:49 +0000 Subject: [PATCH] 00_MQTT2_CLIENT.pm: change separator from : to \0 (Forum #96608) git-svn-id: https://svn.fhem.de/fhem/trunk@18462 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/00_MQTT2_CLIENT.pm | 4 ++-- fhem/FHEM/00_MQTT2_SERVER.pm | 4 ++-- fhem/FHEM/10_MQTT2_DEVICE.pm | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/fhem/FHEM/00_MQTT2_CLIENT.pm b/fhem/FHEM/00_MQTT2_CLIENT.pm index d6d4f599c..ab2ef31a9 100644 --- a/fhem/FHEM/00_MQTT2_CLIENT.pm +++ b/fhem/FHEM/00_MQTT2_CLIENT.pm @@ -340,10 +340,10 @@ MQTT2_CLIENT_Read($@) if(!IsDisabled($name)) { $val = "" if(!defined($val)); - my $ac = AttrVal($name, "autocreate", undef) ? "autocreate:":""; + my $ac = AttrVal($name, "autocreate", undef) ? "autocreate\0":""; my $cid = $hash->{clientId}; $tp =~ s/:/_/g; # 96608 - Dispatch($hash, "$ac$cid:$tp:$val", undef, !$ac); + Dispatch($hash, "$ac$cid\0$tp\0$val", undef, !$ac); my $re = AttrVal($name, "rawEvents", undef); DoTrigger($name, "$tp:$val") if($re && $tp =~ m/$re/); diff --git a/fhem/FHEM/00_MQTT2_SERVER.pm b/fhem/FHEM/00_MQTT2_SERVER.pm index aeb81eb4d..9d8f41180 100644 --- a/fhem/FHEM/00_MQTT2_SERVER.pm +++ b/fhem/FHEM/00_MQTT2_SERVER.pm @@ -419,8 +419,8 @@ MQTT2_SERVER_doPublish($$$$;$) AttrVal($serverName, "rePublish", undef)) { $cid = $src->{NAME} if(!defined($cid)); $cid =~ s,[^a-z0-9._],_,gi; - my $ac = AttrVal($serverName, "autocreate", 1) ? "autocreate:":""; - Dispatch($server, "$ac$cid:$tp:$val", undef, !$ac); + my $ac = AttrVal($serverName, "autocreate", 1) ? "autocreate\0":""; + Dispatch($server, "$ac$cid\0$tp\0$val", undef, !$ac); my $re = AttrVal($serverName, "rawEvents", undef); DoTrigger($server->{NAME}, "$tp:$val") if($re && $tp =~ m/$re/); } diff --git a/fhem/FHEM/10_MQTT2_DEVICE.pm b/fhem/FHEM/10_MQTT2_DEVICE.pm index 7d5630244..4da09e239 100644 --- a/fhem/FHEM/10_MQTT2_DEVICE.pm +++ b/fhem/FHEM/10_MQTT2_DEVICE.pm @@ -90,12 +90,12 @@ MQTT2_DEVICE_Parse($$) } my $autocreate; - if($msg =~ m/^autocreate:(.*)$/s) { + if($msg =~ m/^autocreate\0(.*)$/s) { $msg = $1; $autocreate = 1; } - my ($cid, $topic, $value) = split(":", $msg, 3); + my ($cid, $topic, $value) = split("\0", $msg, 3); my $dp = $modules{MQTT2_DEVICE}{defptr}{re}; foreach my $re (keys %{$dp}) { my $reAll = $re;