enhanced codepot_json_encode
This commit is contained in:
		| @ -76,9 +76,13 @@ if ( ! function_exists('codepot_dbdatetodispdate')) | |||||||
|  |  | ||||||
| if ( !function_exists ('codepot_json_encode')) | 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) ); | 			$islist = is_array($data) && ( empty($data) || array_keys($data) === range(0,count($data)-1) ); | ||||||
|  |  | ||||||
|  | |||||||
| @ -196,11 +196,7 @@ var wiki_text_editor = null; | |||||||
| var work_in_progress = false; | var work_in_progress = false; | ||||||
| var wiki_original_name = '<?php print addslashes($wiki->name); ?>'; | var wiki_original_name = '<?php print addslashes($wiki->name); ?>'; | ||||||
| var wiki_new_name = ''; | var wiki_new_name = ''; | ||||||
| <?php if (function_exists('json_encode')): ?> | var wiki_original_text = <?php print codepot_json_encode($wiki->text); ?>; | ||||||
| var wiki_original_text = <?php print json_encode($wiki->text); ?>; |  | ||||||
| <?php else: ?> |  | ||||||
| var wiki_original_text = '<?php print addcslashes($wiki->text, "\0..\37'\"\\"); ?>'; |  | ||||||
| <?php endif; ?> |  | ||||||
|  |  | ||||||
| function show_in_progress_message (outputMsg, titleMsg) | function show_in_progress_message (outputMsg, titleMsg) | ||||||
| { | { | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user