Remove workaround hack for php bug 46944
authorReedy <reedy@wikimedia.org>
Sun, 12 Aug 2012 20:11:34 +0000 (21:11 +0100)
committerGerrit Code Review <gerrit@wikimedia.org>
Sun, 12 Aug 2012 21:11:46 +0000 (21:11 +0000)
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

includes/json/FormatJson.php

index d3cc550..bbcc185 100644 (file)
@@ -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 {