From 3bad9dc8c00a074eb6c34bdf23f9d949c40b3660 Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Wed, 13 Jan 2016 13:13:13 +0000 Subject: [PATCH] enhanced codepot_json_encode --- codepot/src/codepot/helpers/codepot_helper.php | 10 +++++++--- codepot/src/codepot/views/wiki_editx.php | 6 +----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/codepot/src/codepot/helpers/codepot_helper.php b/codepot/src/codepot/helpers/codepot_helper.php index ded1df78..8fd946e5 100644 --- a/codepot/src/codepot/helpers/codepot_helper.php +++ b/codepot/src/codepot/helpers/codepot_helper.php @@ -76,9 +76,13 @@ if ( ! function_exists('codepot_dbdatetodispdate')) if ( !function_exists ('codepot_json_encode')) { - function codepot_json_encode( $data ) + function codepot_json_encode($data) { - if( is_array($data) || is_object($data) ) + if (function_exists('json_encode')) + { + return json_encode($data); + } + else if( is_array($data) || is_object($data) ) { $islist = is_array($data) && ( empty($data) || array_keys($data) === range(0,count($data)-1) ); @@ -157,7 +161,7 @@ if ( !function_exists ('codepot_json_encode')) if ( !function_exists ('codepot_delete_files')) { function codepot_delete_files($path, $del_dir = FALSE, $level = 0) - { + { // Trim the trailing slash $path = rtrim($path, DIRECTORY_SEPARATOR); diff --git a/codepot/src/codepot/views/wiki_editx.php b/codepot/src/codepot/views/wiki_editx.php index 1af488ac..e92e8295 100644 --- a/codepot/src/codepot/views/wiki_editx.php +++ b/codepot/src/codepot/views/wiki_editx.php @@ -196,11 +196,7 @@ var wiki_text_editor = null; var work_in_progress = false; var wiki_original_name = 'name); ?>'; var wiki_new_name = ''; - -var wiki_original_text = text); ?>; - -var wiki_original_text = 'text, "\0..\37'\"\\"); ?>'; - +var wiki_original_text = text); ?>; function show_in_progress_message (outputMsg, titleMsg) {