From: Reedy Date: Sun, 12 Aug 2012 20:11:34 +0000 (+0100) Subject: Remove workaround hack for php bug 46944 X-Git-Tag: 1.31.0-rc.0~22761 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22suivi_revisions%22%29%20.%20%22?a=commitdiff_plain;h=de185ca16f1a39ed3b1fefa0685d1714a94aaebd;p=lhc%2Fweb%2Fwiklou.git Remove workaround hack for php bug 46944 https://bugs.php.net/bug.php?id=46944 Fixed for 5.3.0, and as we require >= 5.3.2, workaround is redundant http://php.net/ChangeLog-5.php Change-Id: I567466c0c747dba2f903e9258d0f06f725cefb8f --- diff --git a/includes/json/FormatJson.php b/includes/json/FormatJson.php index d3cc55011a..bbcc1856bd 100644 --- a/includes/json/FormatJson.php +++ b/includes/json/FormatJson.php @@ -41,10 +41,7 @@ class FormatJson { * @return string */ public static function encode( $value, $isHtml = false ) { - // 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 ) { $json = new Services_JSON(); return $json->encode( $value, $isHtml ); } else {