From 6c342f7db53e748c3c93aa473e7edc5870fe901c Mon Sep 17 00:00:00 2001 From: Sean Harvey Date: Tue, 22 Apr 2008 02:21:03 +0000 Subject: [PATCH] FEATURE: Ticket #2408 - Merged patch to Convert::array2json() which makes uses of the PHP function json_encode when available git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@53182 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- core/Convert.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/Convert.php b/core/Convert.php index 1dd5bf107..5e9d4ed59 100755 --- a/core/Convert.php +++ b/core/Convert.php @@ -143,6 +143,9 @@ class Convert extends Object { } static function array2json( $array ) { + if(function_exists("json_encode")) { + return json_encode($array); + } $result = array(); // Debug::show($array);