2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-05-05 14:29:35 +00:00

50_SSChatBot.pm: contrib 1.11.6

git-svn-id: https://svn.fhem.de/fhem/trunk@22939 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
nasseeder1 2020-10-07 21:41:29 +00:00
parent b8c64699f8
commit a25a16ba36

View File

@ -35,6 +35,7 @@ package FHEM::SSChatBot;
use strict; use strict;
use warnings; use warnings;
use utf8;
use GPUtils qw(GP_Import GP_Export); # wird für den Import der FHEM Funktionen aus der fhem.pl benötigt use GPUtils qw(GP_Import GP_Export); # wird für den Import der FHEM Funktionen aus der fhem.pl benötigt
use FHEM::SynoModules::API qw(apistatic); # API Modul use FHEM::SynoModules::API qw(apistatic); # API Modul
@ -534,6 +535,7 @@ sub _setasyncSendItem {
return qq{Your sendstring is incorrect. It must contain at least text with the "text=" tag like text="..."\nor only some text like "this is a test" without the "text=" tag.} if(!$text); return qq{Your sendstring is incorrect. It must contain at least text with the "text=" tag like text="..."\nor only some text like "this is a test" without the "text=" tag.} if(!$text);
$text = decode("utf8", $text);
$text = formString($text, "text"); $text = formString($text, "text");
$users = AttrVal($name,"defaultPeer", "") if(!$users); $users = AttrVal($name,"defaultPeer", "") if(!$users);
@ -1365,7 +1367,10 @@ sub formString {
"&" => "%26", # & ist im Text nicht erlaubt und wird encodiert "&" => "%26", # & ist im Text nicht erlaubt und wird encodiert
"%" => "%25", # % ist nicht erlaubt und wird encodiert "%" => "%25", # % ist nicht erlaubt und wird encodiert
"+" => "%2B", "+" => "%2B",
"\\x{c3}\\x{85}" => "%C3%85", "\\x{c3}" => "%C3",
"\\x{85}" => "%85",
"\\x{bc}" => "%BC",
"\\x{9c}" => "%9C",
); );
} }
else { else {
@ -1388,7 +1393,7 @@ sub formString {
$txt =~ s/($pat)/$replacements{$1}/xg; $txt =~ s/($pat)/$replacements{$1}/xg;
return ($txt); return $txt;
} }
############################################################################################# #############################################################################################