# HG changeset patch # User Dan # Date 1261041981 18000 # Node ID 3c73e1b6d33fc8a7953772562c6f33f6a48e0d67 # Parent b20ec1599bfe29f9503077bc861ea3c8f399bb5e JSON preparser: fixed corruption of strings that include the exact pattern word, comma, space, word, colon diff -r b20ec1599bfe -r 3c73e1b6d33f includes/functions.php --- a/includes/functions.php Sun Dec 13 03:56:18 2009 -0500 +++ b/includes/functions.php Thu Dec 17 04:26:21 2009 -0500 @@ -4790,7 +4790,7 @@ '#/\*(.+)\*/\s*$#Us' ), '', $json); - $json = preg_replace('/([,\{\[])([\s]*?)([a-z0-9_]+)([\s]*?):/', '\\1\\2"\\3" :', $json); + $json = preg_replace('/([,\{\[])(?:[\r\n]+)([\s]*?)([a-z0-9_]+)([\s]*?):/', '\\1\\2"\\3" :', $json); return $json; }