summaryrefslogtreecommitdiffstats
path: root/inc/up_json_encode.php
diff options
context:
space:
mode:
Diffstat (limited to 'inc/up_json_encode.php')
-rw-r--r--inc/up_json_encode.php7
1 files changed, 7 insertions, 0 deletions
diff --git a/inc/up_json_encode.php b/inc/up_json_encode.php
index 28556923..c33cb012 100644
--- a/inc/up_json_encode.php
+++ b/inc/up_json_encode.php
@@ -1,5 +1,10 @@
<?php
+if (defined('JSON_PRETTY_PRINT'))
+ define('JSON_NATIVE', true);
+else
+ define('JSON_NATIVE', false);
+
/**
* api: php
* title: upgrade.php
@@ -78,6 +83,8 @@ if (!defined("JSON_UNESCAPED_SLASHES")) {
function up_json_encode($var, $options = 0, $_indent = "")
{
+ if (defined('JSON_NATIVE') && JSON_NATIVE)
+ return json_encode($var, $options);
global ${'.json_last_error'};
${'.json_last_error'} = JSON_ERROR_NONE;