From 040571dbb13c148147a105a8c0857057c358093c Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Thu, 3 May 2012 00:33:38 +0200 Subject: also skip native JSON encoding when skipnative is true --- inc/JSON.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/inc/JSON.php b/inc/JSON.php index b31340f44..012697eb3 100644 --- a/inc/JSON.php +++ b/inc/JSON.php @@ -136,7 +136,9 @@ class JSON { * @access public */ function encode($var) { - if (function_exists('json_encode')) return json_encode($var); + if (!$this->skipnative && function_exists('json_encode')){ + return json_encode($var); + } switch (gettype($var)) { case 'boolean': return $var ? 'true' : 'false'; -- cgit v1.2.3