From 18a393cbda92d10b28978060bb6d0576b0bee7c9 Mon Sep 17 00:00:00 2001 From: DS_Starter Date: Sun, 1 Nov 2020 21:34:27 +0000 Subject: [PATCH] 50_SSChatBot: quotation marks can be used in text tag of received messages git-svn-id: https://svn.fhem.de/fhem/trunk@23070 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/CHANGED | 2 ++ fhem/FHEM/50_SSChatBot.pm | 18 ++++++++++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/fhem/CHANGED b/fhem/CHANGED index 974beda21..6ca1c8742 100644 --- a/fhem/CHANGED +++ b/fhem/CHANGED @@ -1,5 +1,7 @@ # Add changes at the top of the list. Keep it in ASCII, and 80-char wide. # Do not insert empty lines here, update check depends on it. + - change: 50_SSChatBot: quotation marks can be used in text tag of received + messages - feature: 10_FRM: Device::Firmata, receiveTimeout, ... (forum #114552) - feature: 20_FRM_*: Device::Firmata, ... (forum #114552) - change: 20_FRM_LCD: removed, use I2C_LCD (forum #114552) diff --git a/fhem/FHEM/50_SSChatBot.pm b/fhem/FHEM/50_SSChatBot.pm index 8ef606be4..429e0cb2c 100644 --- a/fhem/FHEM/50_SSChatBot.pm +++ b/fhem/FHEM/50_SSChatBot.pm @@ -134,6 +134,7 @@ BEGIN { # Versions History intern my %vNotesIntern = ( + "1.11.7" => "01.11.2020 quotation marks can be used in text tag of received messages (__botCGIcheckData) ", "1.11.6" => "08.10.2020 add urlEncode of character codes like \x{c3}\x{85} to formString ", "1.11.5" => "06.10.2020 use addSendqueue from SMUtils, delete local addSendqueue ", "1.11.4" => "05.10.2020 use setCredentials from SMUtils ", @@ -1552,8 +1553,21 @@ sub __botCGIcheckData { $args =~ s/=/="/gx; $args .= "\""; - $args = urlDecode($args); - my($a,$h) = parseParams($args); + $args = urlDecode($args); + + my $ca = $args; + my ($teco) = $ca =~ /text="(.*)"/x; # " im Text-Tag escapen (V: 1.11.7) + if ($teco) { + $teco =~ s/"/_ESC_/gx; + $ca =~ s/text="(.*)"/text="$teco"/x; + } + + my($a,$h) = parseParams($ca); + + for my $k (%$h) { # Text escaped " wiederherstellen + next if($k ne "text"); + $h->{$k} =~ s/_ESC_/"/gx; + } if (!defined($h->{botname})) { Log 1, "TYPE SSChatBot - ERROR - no Botname received";