diff options
author | Andreas Gohr <andi@splitbrain.org> | 2012-05-03 00:33:38 +0200 |
---|---|---|
committer | Andreas Gohr <andi@splitbrain.org> | 2012-05-03 00:33:38 +0200 |
commit | 040571dbb13c148147a105a8c0857057c358093c (patch) | |
tree | 304e1f7baa5466a8feee30808e432db3e405f7d7 /inc/JSON.php | |
parent | 68fd957c45210715c7b3fcfc2975d8a38977ee02 (diff) | |
download | rpg-040571dbb13c148147a105a8c0857057c358093c.tar.gz rpg-040571dbb13c148147a105a8c0857057c358093c.tar.bz2 |
also skip native JSON encoding when skipnative is true
Diffstat (limited to 'inc/JSON.php')
-rw-r--r-- | inc/JSON.php | 4 |
1 files changed, 3 insertions, 1 deletions
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'; |