only walk an array

This commit is contained in:
Thomas Müller 2013-12-18 15:25:28 +01:00
parent 277ae28171
commit 6c707323f2

View file

@ -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);
}
}