r86253 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r86252‎ | r86253 | r86254 >
Date:10:48, 17 April 2011
Author:catrope
Status:ok
Tags:
Comment:
Fix broken check for bad JSON encoders, had been broken since inception and caused the native JSON encoder to always be bypassed in favor of Services_JSON.
Modified paths:
  • /trunk/phase3/includes/json/FormatJson.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/json/FormatJson.php
@@ -30,7 +30,11 @@
3131 // Some versions of PHP have a broken json_encode, see PHP bug
3232 // 46944. Test encoding an affected character (U+20000) to
3333 // avoid this.
34 - if ( !function_exists( 'json_encode' ) || $isHtml || strtolower( json_encode( "\xf0\xa0\x80\x80" ) ) != '\ud840\udc00' ) {
 34+ if ( !function_exists( 'json_encode' ) || $isHtml || strtolower( json_encode( "\xf0\xa0\x80\x80" ) ) != '"\ud840\udc00"' ) {
 35+ var_dump(function_exists('json_encode'));
 36+ var_dump($isHtml);
 37+ var_dump(strtolower(json_encode("\xf0\xa0\x80\x80")));
 38+ var_dump('\ud840\udc00');
3539 $json = new Services_JSON();
3640 return $json->encode( $value, $isHtml );
3741 } else {

Follow-up revisions

RevisionCommit summaryAuthorDate
r86254Remove debugging code accidentally committed in r86253catrope10:49, 17 April 2011

Status & tagging log