JSON preparser: fixed corruption of strings that include the exact pattern word, comma, space, word, colon
authorDan
Thu, 17 Dec 2009 04:26:21 -0500
changeset 1167 3c73e1b6d33f
parent 1166 b20ec1599bfe
child 1168 277a9cdead3e
JSON preparser: fixed corruption of strings that include the exact pattern word, comma, space, word, colon
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;
 }