Skip to content

Commit

Permalink
also skip native JSON encoding when skipnative is true
Browse files Browse the repository at this point in the history
  • Loading branch information
splitbrain committed May 2, 2012
1 parent 68fd957 commit 040571d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion inc/JSON.php
Expand Up @@ -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';
Expand Down

0 comments on commit 040571d

Please sign in to comment.