diff --git a/inc/JSON.php b/inc/JSON.php index b31340f448..012697eb3b 100644 --- a/inc/JSON.php +++ b/inc/JSON.php @@ -136,7 +136,9 @@ function JSON($use=JSON_STRICT_TYPE) { * @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';