X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2Fjson%2FFormatJson.php;h=bd6a365466052c8700707cd31a9984387bd5252b;hp=775ab43c981000238d9a3e1a96580cecf942441d;hb=942728ab20e01bba200031b01eb606ee59279bd2;hpb=f43fa6f4f0e2cb60b8543daad661b48a3e0653a9 diff --git a/includes/json/FormatJson.php b/includes/json/FormatJson.php index 775ab43c98..bd6a365466 100644 --- a/includes/json/FormatJson.php +++ b/includes/json/FormatJson.php @@ -216,7 +216,7 @@ class FormatJson { $count = 0; $value = preg_replace( '/,([ \t]*[}\]][^"\r\n]*([\r\n]|$)|[ \t]*[\r\n][ \t\r\n]*[}\]])/', '$1', - $value, - 1, $count ); + $value, -1, $count ); if ( $count > 0 ) { $result = json_decode( $value, $assoc ); if ( JSON_ERROR_NONE === json_last_error() ) { @@ -271,7 +271,7 @@ class FormatJson { */ public static function stripComments( $json ) { // Ensure we have a string - $str = (string) $json; + $str = (string)$json; $buffer = ''; $maxLen = strlen( $str ); $mark = 0; @@ -294,7 +294,7 @@ class FormatJson { $lookAhead = ( $idx + 1 < $maxLen ) ? $str[$idx + 1] : ''; $lookBehind = ( $idx - 1 >= 0 ) ? $str[$idx - 1] : ''; if ( $inString ) { - continue; + break; } elseif ( !$inComment && ( $lookAhead === '/' || $lookAhead === '*' )