From 2086d4f3fabbf9c891e9c253e42af44d9af62e5f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 18 Mar 2012 17:31:36 +0100 Subject: [PATCH] Add TODO comments --- htdocs/core/lib/functions.lib.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 38abb60ee7c..875c1277210 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -146,18 +146,24 @@ if (! function_exists('json_decode')) } /** - * Function that encodes data in json format + * Function that encodes data in json format. + * TODO Remove this function because the json_encode is already redesigned by dolibarr function and + * this functions was designed for compatibility between an instable 3.2 version with final 3.2 version. We must + * manage compatibility only between 2 stable versions. * * @param mixed $elements PHP object to json encode * @return string Json encoded string */ function dol_json_encode($elements) { - return json_encode($elements); + return json_encode($elements); // This function is redesigned into functions.lib.php } /** * Function that decodes data from json format + * TODO Remove this function because the json_encode is already redesigned by dolibarr function and + * this functions was designed for compatibility between an instable 3.2 version with final 3.2 version. We must + * manage compatibility only between 2 stable versions. * * @param string $json Json encoded to PHP Object or Array * @param bool $assoc False return an object, true return an array @@ -167,7 +173,7 @@ function dol_json_decode($json, $assoc=false) { $out=''; $out = @unserialize($json); // For compatibility, test if serialized - if (empty($out)) $out = json_decode($json, $assoc); + if (empty($out)) $out = json_decode($json, $assoc); // This function is redesigned into functions.lib.php return $out; }