FRITZBOX: handels now illegal backslash \' in JSON-Text

git-svn-id: svn://svn.code.sf.net/p/fhem/code/trunk@9367 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
tpoitzsch
2015-10-04 12:40:48 +00:00
parent 71d7dd929b
commit a926af6af2

View File

@@ -2930,8 +2930,7 @@ sub FRITZBOX_Ring_Run_Web($)
my $getCmdStr = "&ring_tone_radio_test=1&idx=".$_."&start_ringtest=1&ringtone=".$value;
FRITZBOX_Log $hash, 4, "Reset ring tone of dect$_ to $value";
# Reset internet station for the Fritz!Fons
if ($ttsLink)
{
if ($ttsLink) {
$value = $startValue->{dectUser}->[$_]->{RadioRingID};
push @webCmdArray, "telcfg:settings/Foncontrol/User".$_."/RadioRingID" => $value
unless $useGuiHack;
@@ -4280,11 +4279,15 @@ sub FRITZBOX_Web_Query($$@)
# FRITZBOX_Log $hash, 3, "Response: ".$response->content;
#################
my $jsonText = $response->content;
# Remove illegal excape sequences
$jsonText =~ s/\\'/'/g;
my $jsonResult ;
if ($charSet eq "UTF-8") {
$jsonResult = JSON->new->utf8->decode ($response->content);
$jsonResult = JSON->new->utf8->decode( $jsonText );
} else {
$jsonResult = JSON ->new->latin1->decode ($response->content);
$jsonResult = JSON->new->latin1->decode( $jsonText );
}
$jsonResult->{sid} = $sid;
return $jsonResult;