From df2262f8be0d51709e25861ceea36140c06e5607 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a?= Date: Tue, 16 Oct 2012 12:18:05 +0200 Subject: [PATCH] Stopped using (un)serialize functions but json functions --- htdocs/admin/syslog.php | 4 ++-- htdocs/core/lib/functions.lib.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/admin/syslog.php b/htdocs/admin/syslog.php index 18dfabefcb0..88ebf1d9456 100644 --- a/htdocs/admin/syslog.php +++ b/htdocs/admin/syslog.php @@ -37,7 +37,7 @@ $action = GETPOST("action"); $syslogModules = array(); $activeModules = array(); -if (defined('SYSLOG_HANDLERS')) $activeModules = unserialize(SYSLOG_HANDLERS); +if (defined('SYSLOG_HANDLERS')) $activeModules = json_decode(SYSLOG_HANDLERS); $dir = dol_buildpath('/core/modules/syslog/'); @@ -105,7 +105,7 @@ if ($action == 'set') } } - dolibarr_set_const($db, 'SYSLOG_HANDLERS', serialize($activeModules), 'chaine'); + dolibarr_set_const($db, 'SYSLOG_HANDLERS', json_encode($activeModules), 'chaine'); if (! $error) { diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 150c7c5948d..e4d869a4287 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -521,7 +521,7 @@ function dol_syslog($message, $level = LOG_INFO) else if (! empty($_SERVER['LOGNAME'])) $data['ip'] = '???@'.$_SERVER['LOGNAME']; //We load SYSLOG handlers - if (defined('SYSLOG_HANDLERS')) $handlers = unserialize(SYSLOG_HANDLERS); + if (defined('SYSLOG_HANDLERS')) $handlers = json_decode(SYSLOG_HANDLERS); else $handlers = array(); foreach ($handlers as $handler)