diff --git a/core/api/jeeApi.php b/core/api/jeeApi.php index 5bb0adeec1..3b4492498b 100644 --- a/core/api/jeeApi.php +++ b/core/api/jeeApi.php @@ -37,7 +37,7 @@ if (init('type') != '') { try { - + if (init('type') == 'ask') { if (trim(init('token')) == '' || strlen(init('token')) < 64) { throw new Exception(__('Commande inconnue ou Token invalide', __FILE__)); @@ -1276,7 +1276,7 @@ throw new Exception(__('Vous n\'avez pas les droits de faire cette action', __FILE__), -32701); } unautorizedInDemo(); - jeedom::update(''); + jeedom::update(); $jsonrpc->makeSuccess('ok'); } diff --git a/core/api/proApi.php b/core/api/proApi.php index 1e9b781402..d3c6bd5b63 100644 --- a/core/api/proApi.php +++ b/core/api/proApi.php @@ -728,7 +728,7 @@ } if ($jsonrpc->getMethod() == 'update::update') { - jeedom::update(''); + jeedom::update(); $jsonrpc->makeSuccess('ok'); } diff --git a/core/class/jeedom.class.php b/core/class/jeedom.class.php index fb1a145157..4fbe7170e3 100644 --- a/core/class/jeedom.class.php +++ b/core/class/jeedom.class.php @@ -880,10 +880,8 @@ public static function restore(string $_backup = '', bool $_background = false) public static function update(array $_options = []) { log::clear('update'); $params = ''; - if (count($_options) > 0) { - foreach ($_options as $key => $value) { - $params .= '"' . $key . '"="' . $value . '" '; - } + foreach ($_options as $key => $value) { + $params .= '"' . $key . '"="' . $value . '" '; } $cmd = __DIR__ . '/../../install/update.php ' . $params; $cmd .= ' >> ' . log::getPathToLog('update') . ' 2>&1 &';