summaryrefslogtreecommitdiff
path: root/includes/json/FormatJson.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/json/FormatJson.php')
-rw-r--r--includes/json/FormatJson.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/includes/json/FormatJson.php b/includes/json/FormatJson.php
index b7049aeb..006f7720 100644
--- a/includes/json/FormatJson.php
+++ b/includes/json/FormatJson.php
@@ -18,6 +18,11 @@ class FormatJson {
*
* @param $value Mixed: the value being encoded. Can be any type except a resource.
* @param $isHtml Boolean
+ *
+ * @todo FIXME: "$isHtml" parameter's purpose is not documented. It appears to
+ * map to a parameter labeled "pretty-print output with indents and
+ * newlines" in Services_JSON::encode(), which has no string relation
+ * to HTML output.
*
* @return string
*/
@@ -25,7 +30,7 @@ class FormatJson {
// Some versions of PHP have a broken json_encode, see PHP bug
// 46944. Test encoding an affected character (U+20000) to
// avoid this.
- if ( !function_exists( 'json_encode' ) || $isHtml || strtolower( json_encode( "\xf0\xa0\x80\x80" ) ) != '\ud840\udc00' ) {
+ if ( !function_exists( 'json_encode' ) || $isHtml || strtolower( json_encode( "\xf0\xa0\x80\x80" ) ) != '"\ud840\udc00"' ) {
$json = new Services_JSON();
return $json->encode( $value, $isHtml );
} else {