mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-10 09:16:53 +00:00
fhem.pl: Fix for json2nameValue multi Prefix (Forum #108828)
git-svn-id: https://svn.fhem.de/fhem/trunk@21311 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
cd3dc91f2b
commit
0c8b66e869
@ -5167,6 +5167,7 @@ json2nameValue($;$$)
|
|||||||
{
|
{
|
||||||
my ($ret,$map,$name,$val,$in,$prefix,$firstLevel) = @_;
|
my ($ret,$map,$name,$val,$in,$prefix,$firstLevel) = @_;
|
||||||
my $err;
|
my $err;
|
||||||
|
$prefix="" if(!$firstLevel);
|
||||||
|
|
||||||
if($val =~ m/^"/) {
|
if($val =~ m/^"/) {
|
||||||
($err, $val, $in) = lStr($val);
|
($err, $val, $in) = lStr($val);
|
||||||
@ -5197,8 +5198,9 @@ json2nameValue($;$$)
|
|||||||
my $idx = 1;
|
my $idx = 1;
|
||||||
$val =~ s/^\s*//;
|
$val =~ s/^\s*//;
|
||||||
while($val) {
|
while($val) {
|
||||||
($err,$val) = eObj($ret, $map, $firstLevel ? $idx : $name."_$idx",
|
($err,$val) = eObj($ret, $map,
|
||||||
$val, $val, $prefix);
|
$firstLevel ? "$prefix$idx" : $name."_$idx",
|
||||||
|
$val, $val, $prefix);
|
||||||
return ($err,undef) if($err);
|
return ($err,undef) if($err);
|
||||||
$val =~ s/^\s*,\s*//;
|
$val =~ s/^\s*,\s*//;
|
||||||
$val =~ s/\s*$//;
|
$val =~ s/\s*$//;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user