]> source.dussan.org Git - nextcloud-server.git/commitdiff
only walk an array
authorThomas Müller <thomas.mueller@tmit.eu>
Wed, 18 Dec 2013 14:25:28 +0000 (15:25 +0100)
committerThomas Müller <thomas.mueller@tmit.eu>
Wed, 18 Dec 2013 14:25:28 +0000 (15:25 +0100)
lib/private/json.php

index 8401f7c3a129200dae3382ad8757a0cb85187ec1..6a9e5a2df5e735c4985035a7103d512ae581682a 100644 (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);
        }
 }