summaryrefslogtreecommitdiffstats
path: root/lib/private/json.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/json.php')
-rw-r--r--lib/private/json.php9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/private/json.php b/lib/private/json.php
index 6ba0b13806b..8401f7c3a12 100644
--- a/lib/private/json.php
+++ b/lib/private/json.php
@@ -109,7 +109,14 @@ class OC_JSON{
if($setContentType) {
self::setContentTypeHeader();
}
+ echo self::encode($data);
+ }
+
+ /**
+ * Encode JSON
+ */
+ public static function encode($data) {
array_walk_recursive($data, array('OC_JSON', 'to_string'));
- echo json_encode($data);
+ return json_encode($data);
}
}