Mailing List Archive

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Remove workaround for old PHP JSON handling bug
MaxSem has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/405999 )

Change subject: Remove workaround for old PHP JSON handling bug
......................................................................

Remove workaround for old PHP JSON handling bug

The bug was fixed in PHP 5.5.12, which makes this irrelevant with
PHP 7 transition.

Change-Id: If21d2c4f68b1c6996e6685a42711ed188bee51d7
---
M includes/json/FormatJson.php
1 file changed, 0 insertions(+), 9 deletions(-)


git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/99/405999/1

diff --git a/includes/json/FormatJson.php b/includes/json/FormatJson.php
index 0c77a7b..0907c12 100644
--- a/includes/json/FormatJson.php
+++ b/includes/json/FormatJson.php
@@ -129,11 +129,6 @@
$pretty = $pretty ? ' ' : false;
}

- static $bug66021;
- if ( $pretty !== false && $bug66021 === null ) {
- $bug66021 = json_encode( [], JSON_PRETTY_PRINT ) !== '[]';
- }
-
// PHP escapes '/' to prevent breaking out of inline script blocks using '</script>',
// which is hardly useful when '<' and '>' are escaped (and inadequate), and such
// escaping negatively impacts the human readability of URLs and similar strings.
@@ -147,10 +142,6 @@
}

if ( $pretty !== false ) {
- // Workaround for <https://bugs.php.net/bug.php?id=66021>
- if ( $bug66021 ) {
- $json = preg_replace( self::WS_CLEANUP_REGEX, '', $json );
- }
if ( $pretty !== ' ' ) {
// Change the four-space indent to a tab indent
$json = str_replace( "\n ", "\n\t", $json );

--
To view, visit https://gerrit.wikimedia.org/r/405999
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: If21d2c4f68b1c6996e6685a42711ed188bee51d7
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: MaxSem <maxsem.wiki@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits