1
0
Fork 0

Fix unescaped backslash issue

pull/90/merge
Jordi Boggiano 2011-11-05 23:53:20 +01:00
parent 4002cab25b
commit 293c45fabe
1 changed files with 1 additions and 1 deletions

View File

@ -124,7 +124,7 @@ class JsonFile
$charOffset = 0; $charOffset = 0;
if (preg_match('#["}\]]\s*(,)\s*[}\]]#', $json, $match, PREG_OFFSET_CAPTURE)) { if (preg_match('#["}\]]\s*(,)\s*[}\]]#', $json, $match, PREG_OFFSET_CAPTURE)) {
$msg .= ', extra comma'; $msg .= ', extra comma';
} elseif (preg_match('#(\\\\(?!["\\/bfnrt]|u[a-f0-9]{4}))#i', $json, $match, PREG_OFFSET_CAPTURE)) { } elseif (preg_match('#((?<=[^\\\\])\\\\(?!["\\\\/bfnrt]|u[a-f0-9]{4}))#i', $json, $match, PREG_OFFSET_CAPTURE)) {
$msg .= ', unescaped backslash (\\)'; $msg .= ', unescaped backslash (\\)';
} elseif (preg_match('#(["}\]]) *\r?\n *"#', $json, $match, PREG_OFFSET_CAPTURE)) { } elseif (preg_match('#(["}\]]) *\r?\n *"#', $json, $match, PREG_OFFSET_CAPTURE)) {
$msg .= ', missing comma'; $msg .= ', missing comma';