Siebrand has uploaded a new change for review. https://gerrit.wikimedia.org/r/97533
Change subject: Update formatting and comments in FormatJson ...................................................................... Update formatting and comments in FormatJson Change-Id: I4edc08760004e170b045b201d3cc5444b2028e55 --- M includes/json/FormatJson.php 1 file changed, 5 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/33/97533/1 diff --git a/includes/json/FormatJson.php b/includes/json/FormatJson.php index d611651..83718c3 100644 --- a/includes/json/FormatJson.php +++ b/includes/json/FormatJson.php @@ -24,7 +24,6 @@ * JSON formatter wrapper class */ class FormatJson { - /** * Skip escaping most characters above U+007F for readability and compactness. * This encoding option saves 3 to 8 bytes (uncompressed) for each such character; @@ -104,6 +103,7 @@ if ( defined( 'JSON_UNESCAPED_UNICODE' ) ) { return self::encode54( $value, $pretty, $escaping ); } + return self::encode53( $value, $pretty, $escaping ); } @@ -113,7 +113,7 @@ * @param string $value The JSON string being decoded * @param bool $assoc When true, returned objects will be converted into associative arrays. * - * @return mixed: the value encoded in JSON in appropriate PHP type. + * @return mixed The value encoded in JSON in appropriate PHP type. * `null` is returned if the JSON cannot be decoded or if the encoded data is deeper than * the recursion limit. */ @@ -150,6 +150,7 @@ if ( $escaping & self::UTF8_OK ) { $json = str_replace( self::$badChars, self::$badCharsEscaped, $json ); } + return $json; } @@ -190,6 +191,7 @@ if ( $pretty ) { return self::prettyPrint( $json ); } + return $json; } @@ -231,6 +233,7 @@ } } $buf = preg_replace( self::WS_CLEANUP_REGEX, '', $buf ); + return str_replace( "\x01", '\"', $buf ); } } -- To view, visit https://gerrit.wikimedia.org/r/97533 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4edc08760004e170b045b201d3cc5444b2028e55 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Siebrand <siebr...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits