Convert OC_L10N_String to a string in OC_JSON::encodedPrint
This commit is contained in:
parent
432aa58bab
commit
50667dcb82
10
lib/json.php
10
lib/json.php
|
@ -81,6 +81,15 @@ class OC_JSON{
|
||||||
self::encodedPrint($data);
|
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
|
* Encode and print $data in json format
|
||||||
*/
|
*/
|
||||||
|
@ -89,6 +98,7 @@ class OC_JSON{
|
||||||
if($setContentType){
|
if($setContentType){
|
||||||
self::setContentTypeHeader();
|
self::setContentTypeHeader();
|
||||||
}
|
}
|
||||||
|
array_walk_recursive($data, array('OC_JSON', 'to_string'));
|
||||||
echo json_encode($data);
|
echo json_encode($data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue