Skip to content
Snippets Groups Projects
Commit 50667dcb authored by Bart Visscher's avatar Bart Visscher
Browse files

Convert OC_L10N_String to a string in OC_JSON::encodedPrint

parent 432aa58b
No related branches found
No related tags found
No related merge requests found
......@@ -81,6 +81,15 @@ class OC_JSON{
self::encodedPrint($data);
}
/**
* 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
*/
......@@ -89,6 +98,7 @@ class OC_JSON{
if($setContentType){
self::setContentTypeHeader();
}
array_walk_recursive($data, array('OC_JSON', 'to_string'));
echo json_encode($data);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment