diff --git a/e107_handlers/js_helper.php b/e107_handlers/js_helper.php index ca127f7b0..7a8446d2e 100644 --- a/e107_handlers/js_helper.php +++ b/e107_handlers/js_helper.php @@ -15,23 +15,6 @@ * */ -//PHP < 5.2 compatibility -if (!function_exists('json_encode')) -{ - require_once(e_HANDLER.'json_compat_handler.php'); - function json_encode($array) - { - $json = new Services_JSON(); - return $json->encode($array); - } - - function json_decode($json_obj) - { - $json = new Services_JSON(); - return $json->decode($json_obj); - } -} - class e_jshelper { /** diff --git a/e107_handlers/php_compatibility_handler.php b/e107_handlers/php_compatibility_handler.php index d9e847364..da312524f 100644 --- a/e107_handlers/php_compatibility_handler.php +++ b/e107_handlers/php_compatibility_handler.php @@ -264,3 +264,20 @@ if (!function_exists('strptime')) } } + +//PHP < 5.2 compatibility +if (!function_exists('json_encode')) +{ + require_once(e_HANDLER.'json_compat_handler.php'); + function json_encode($array) + { + $json = new Services_JSON(); + return $json->encode($array); + } + + function json_decode($json_obj) + { + $json = new Services_JSON(); + return $json->decode($json_obj); + } +}