dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Use "break" instead of "continue"
[lhc/web/wiklou.git]
/
includes
/
json
/
FormatJson.php
diff --git
a/includes/json/FormatJson.php
b/includes/json/FormatJson.php
index
775ab43
..
bd6a365
100644
(file)
--- 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',
$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() ) {
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
*/
public static function stripComments( $json ) {
// Ensure we have a string
- $str = (string)
$json;
+ $str = (string)$json;
$buffer = '';
$maxLen = strlen( $str );
$mark = 0;
$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 ) {
$lookAhead = ( $idx + 1 < $maxLen ) ? $str[$idx + 1] : '';
$lookBehind = ( $idx - 1 >= 0 ) ? $str[$idx - 1] : '';
if ( $inString ) {
-
continue
;
+
break
;
} elseif ( !$inComment &&
( $lookAhead === '/' || $lookAhead === '*' )
} elseif ( !$inComment &&
( $lookAhead === '/' || $lookAhead === '*' )