From: Thomas Müller Date: Wed, 18 Dec 2013 14:25:28 +0000 (+0100) Subject: only walk an array X-Git-Tag: v7.0.0alpha2~1004^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=6c707323f23d0abc0759ba2d61caf148c5c68edb;p=nextcloud-server.git only walk an array --- diff --git a/lib/private/json.php b/lib/private/json.php index 8401f7c3a12..6a9e5a2df5e 100644 --- a/lib/private/json.php +++ b/lib/private/json.php @@ -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); } }