mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-22 02:10:32 +00:00
70_Pushover: more robust JSON decoding (forum #76842)
git-svn-id: https://svn.fhem.de/fhem/trunk@15162 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
4178b2b380
commit
5475734ad7
@ -537,8 +537,12 @@ sub Pushover_ReceiveCommand($$$) {
|
|||||||
require JSON;
|
require JSON;
|
||||||
import JSON qw( decode_json );
|
import JSON qw( decode_json );
|
||||||
};
|
};
|
||||||
$return = decode_json( Encode::encode_utf8($data) )
|
unless ($@) {
|
||||||
if ( !$@ );
|
my $json = JSON->new->allow_nonref;
|
||||||
|
my $obj =
|
||||||
|
eval { $json->decode( Encode::encode_utf8($data) ) };
|
||||||
|
$return = $obj unless ($@);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if ( !defined($cmd) || ref($cmd) eq "HASH" || $cmd eq "" ) {
|
if ( !defined($cmd) || ref($cmd) eq "HASH" || $cmd eq "" ) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user