diff --git a/htdocs/core/lib/json.lib.php b/htdocs/core/lib/json.lib.php index 7388ba47806..55bfcf96061 100644 --- a/htdocs/core/lib/json.lib.php +++ b/htdocs/core/lib/json.lib.php @@ -42,12 +42,11 @@ if (! function_exists('json_encode')) * * @param mixed $elements PHP Object to json encode * @return string Json encoded string - * @deprecated PHP >= 5.3 supports native json_encode * @see json_encode() */ function dol_json_encode($elements) { - dol_syslog('dol_json_encode() is deprecated. Please update your code to use native json_encode().', LOG_WARNING); + dol_syslog("For better permorfance, enable the native json in your PHP", LOG_WARNING); $num=0; if (is_object($elements)) // Count number of properties for an object diff --git a/htdocs/includes/tcpdi/tcpdi.php b/htdocs/includes/tcpdi/tcpdi.php index 48fdd8198f5..999ff99ea5b 100644 --- a/htdocs/includes/tcpdi/tcpdi.php +++ b/htdocs/includes/tcpdi/tcpdi.php @@ -580,7 +580,7 @@ class TCPDI extends FPDF_TPL { * close all files opened by parsers */ function _closeParsers() { - if ($this->state > 2 && count($this->parsers) > 0) { + if ($this->state > 2 && is_array($this->parsers) && count($this->parsers) > 0) { $this->cleanUp(); return true; }