mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-10 09:16:53 +00:00
fhem.pl: toJSON numeric fix (Forum #100951)
git-svn-id: https://svn.fhem.de/fhem/trunk@19485 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
603aa7bb43
commit
5681205202
@ -5050,6 +5050,9 @@ toJSON($)
|
|||||||
if(not defined $val) {
|
if(not defined $val) {
|
||||||
return "null";
|
return "null";
|
||||||
|
|
||||||
|
} elsif (length( do { no warnings "numeric"; $val & "" } )) {
|
||||||
|
return $val;
|
||||||
|
|
||||||
} elsif (not ref $val) {
|
} elsif (not ref $val) {
|
||||||
$val =~ s/([\x00-\x1f\x22\x5c\x7f])/sprintf '\u%04x', ord($1)/ge;
|
$val =~ s/([\x00-\x1f\x22\x5c\x7f])/sprintf '\u%04x', ord($1)/ge;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user