From 1cd592a62302e758ffc8b165c680ee87d4eeea59 Mon Sep 17 00:00:00 2001 From: Marcin Haba Date: Sun, 12 Nov 2017 16:58:55 +0100 Subject: [PATCH] baculum: Send config to api server as json --- gui/baculum/protected/API/Pages/API/Config.php | 2 +- gui/baculum/protected/Web/Portlets/BaculaConfigDirectives.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gui/baculum/protected/API/Pages/API/Config.php b/gui/baculum/protected/API/Pages/API/Config.php index bec7f40b46..0ecdb0c842 100644 --- a/gui/baculum/protected/API/Pages/API/Config.php +++ b/gui/baculum/protected/API/Pages/API/Config.php @@ -36,7 +36,7 @@ class Config extends BaculumAPIServer { public function set($id, $params) { $config = (array)$params; if (array_key_exists('config', $config)) { - $config = unserialize($config['config']); + $config = json_decode($config['config'], true); } else { $config = array(); } diff --git a/gui/baculum/protected/Web/Portlets/BaculaConfigDirectives.php b/gui/baculum/protected/Web/Portlets/BaculaConfigDirectives.php index 02fc3ec732..32654259aa 100644 --- a/gui/baculum/protected/Web/Portlets/BaculaConfigDirectives.php +++ b/gui/baculum/protected/Web/Portlets/BaculaConfigDirectives.php @@ -303,7 +303,7 @@ class BaculaConfigDirectives extends DirectiveListTemplate { $resource_type, $resource_name ); - $result = $this->Application->getModule('api')->set($params, array('config' => serialize($directives)), $host, false); + $result = $this->Application->getModule('api')->set($params, array('config' => json_encode($directives)), $host, false); if ($result->error === 0) { $this->SaveDirectiveOk->Display = 'Dynamic'; $this->SaveDirectiveError->Display = 'None'; -- 2.39.5