2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-03 16:56:54 +00:00

50_SSChatBot: contrib 1.1.0

git-svn-id: https://svn.fhem.de/fhem/trunk@20833 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
nasseeder1 2019-12-27 12:49:33 +00:00
parent ae968a2a9b
commit 8a1c1847d5

View File

@ -49,6 +49,8 @@ eval "use Net::Domain qw(hostname hostfqdn hostdomain domainname);1" or my $SSC
# Versions History intern
our %SSChatBot_vNotesIntern = (
"1.1.0" => "27.12.2019 both POST- and GET-method are now valid in CGI ",
"1.0.1" => "11.12.2019 check OPIDX in parse sendItem, change error code list, complete forbidSend with error text ",
"1.0.0" => "29.11.2019 initial "
);
@ -1572,8 +1574,15 @@ sub SSChatBot_CGI() {
return ( "text/plain; charset=utf-8", "Booting up" ) unless ($init_done);
# data received
if ($request =~ /^\/outchat?.*/) {
$args = (split(/outchat\?/, $request))[1];
if ($request =~ /^\/outchat(\?|&).*/) { # POST- oder GET-Methode empfangen
$args = (split(/outchat\?/, $request))[1]; # GET-Methode empfangen
if(!$args) { # POST-Methode empfangen wenn keine GET_Methode ?
$args = (split(/outchat&/, $request))[1];
if(!$args) {
Log 1, "TYPE SSChatBot - ERROR - no expected data received";
return ("text/plain; charset=utf-8", "no expected data received");
}
}
$args =~ s/&/" /g;
$args =~ s/=/="/g;
$args .= "\"";