Fomafix has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/348403 )

Change subject: Remove workaround for PHP bug 66021
......................................................................

Remove workaround for PHP bug 66021

The PHP bug 66021 <https://bugs.php.net/bug.php?id=66021> was fixed by
https://github.com/php/php-src/pull/518 and is included in PHP 5.4.
MediaWiki minimum PHP version is 5.5.9. So the workaround is not necessary
anymore.

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


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/03/348403/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/348403
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I801eaffc253fd88e0d3c87cfe97777837bd3902d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Fomafix <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to