diff -r 2b826f2640e9 -r 94214ec0871c includes/functions.php --- a/includes/functions.php Sun Apr 06 14:02:20 2008 -0400 +++ b/includes/functions.php Sun Apr 06 15:30:39 2008 -0400 @@ -4078,6 +4078,17 @@ } /** + * Trims a snippet of text to the first and last curly braces. Useful for JSON. + * @param string Text to trim + * @return string + */ + +function enano_trim_json($json) +{ + return preg_replace('/^([^{]+)\{/', '{', preg_replace('/\}([^}]+)$/', '}', $json)); +} + +/** * Starts the profiler. */