mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-22 08:11:44 +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;
|
||||
import JSON qw( decode_json );
|
||||
};
|
||||
$return = decode_json( Encode::encode_utf8($data) )
|
||||
if ( !$@ );
|
||||
unless ($@) {
|
||||
my $json = JSON->new->allow_nonref;
|
||||
my $obj =
|
||||
eval { $json->decode( Encode::encode_utf8($data) ) };
|
||||
$return = $obj unless ($@);
|
||||
}
|
||||
}
|
||||
else {
|
||||
if ( !defined($cmd) || ref($cmd) eq "HASH" || $cmd eq "" ) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user