From: Marcin Haba Date: Sun, 12 Nov 2017 15:58:55 +0000 (+0100) Subject: baculum: Send config to api server as json X-Git-Tag: Release-9.0.6~41 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=1cd592a62302e758ffc8b165c680ee87d4eeea59;p=bacula%2Fbacula baculum: Send config to api server as json --- 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';