only walk an array
This commit is contained in:
parent
277ae28171
commit
6c707323f2
1 changed files with 3 additions and 1 deletions
|
@ -116,7 +116,9 @@ class OC_JSON{
|
|||
* Encode JSON
|
||||
*/
|
||||
public static function encode($data) {
|
||||
array_walk_recursive($data, array('OC_JSON', 'to_string'));
|
||||
if (is_array($data)) {
|
||||
array_walk_recursive($data, array('OC_JSON', 'to_string'));
|
||||
}
|
||||
return json_encode($data);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue