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:
rudolfkoenig
2019-05-29 16:35:33 +00:00
parent 9d3599b6fd
commit 554a5e364a

View File

@@ -5050,6 +5050,9 @@ toJSON($)
if(not defined $val) {
return "null";
} elsif (length( do { no warnings "numeric"; $val & "" } )) {
return $val;
} elsif (not ref $val) {
$val =~ s/([\x00-\x1f\x22\x5c\x7f])/sprintf '\u%04x', ord($1)/ge;