Fix: regression
This commit is contained in:
parent
d5d4bc33ba
commit
469ae91e70
@ -72,8 +72,10 @@ function dol_json_encode($elements)
|
|||||||
$output = '{';
|
$output = '{';
|
||||||
$last = $num - 1;
|
$last = $num - 1;
|
||||||
$i = 0;
|
$i = 0;
|
||||||
if (is_array($elements) && count($elements)>0) {
|
$tmpelements=array();
|
||||||
foreach($elements as $key => $value)
|
if (is_array($elements)) $tmpelements=$elements;
|
||||||
|
if (is_object($elements)) $tmpelements=get_object_vars($elements);
|
||||||
|
foreach($tmpelements as $key => $value)
|
||||||
{
|
{
|
||||||
$output .= '"'.$key.'":';
|
$output .= '"'.$key.'":';
|
||||||
if (is_array($value)) $output.= json_encode($value);
|
if (is_array($value)) $output.= json_encode($value);
|
||||||
@ -81,7 +83,6 @@ function dol_json_encode($elements)
|
|||||||
if ($i !== $last) $output.= ',';
|
if ($i !== $last) $output.= ',';
|
||||||
++$i;
|
++$i;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
$output.= '}';
|
$output.= '}';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user