aboutsummaryrefslogtreecommitdiffstats
path: root/lib/json.php
diff options
context:
space:
mode:
authorTom Needham <needham.thomas@gmail.com>2012-06-22 16:17:23 +0000
committerTom Needham <needham.thomas@gmail.com>2012-06-22 16:17:23 +0000
commit41cfd55f5501dc90a96d0e1812fbb197e35955ac (patch)
tree99d209f49ca3e0a935ac27a6cac3f03cf552beb9 /lib/json.php
parent0aafc717ec676cbedb21443fc05cd5b0496b8b42 (diff)
parentebfc5b2762053960048b4f6a63ddc33482059edd (diff)
downloadnextcloud-server-41cfd55f5501dc90a96d0e1812fbb197e35955ac.tar.gz
nextcloud-server-41cfd55f5501dc90a96d0e1812fbb197e35955ac.zip
Merge branch 'master' of gitorious.org:owncloud/owncloud
Diffstat (limited to 'lib/json.php')
-rw-r--r--lib/json.php10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/json.php b/lib/json.php
index dfc0a7b894e..4eab4fce9f6 100644
--- a/lib/json.php
+++ b/lib/json.php
@@ -82,6 +82,15 @@ class OC_JSON{
}
/**
+ * Convert OC_L10N_String to string, for use in json encodings
+ */
+ protected static function to_string(&$value){
+ if ($value instanceof OC_L10N_String) {
+ $value = (string)$value;
+ }
+ }
+
+ /**
* Encode and print $data in json format
*/
public static function encodedPrint($data,$setContentType=true){
@@ -89,6 +98,7 @@ class OC_JSON{
if($setContentType){
self::setContentTypeHeader();
}
+ array_walk_recursive($data, array('OC_JSON', 'to_string'));
echo json_encode($data);
}
}