From 7d2c1e5c097f4ab1a7037e5cd85b9bab2a82215d Mon Sep 17 00:00:00 2001 From: Mips2648 Date: Mon, 18 May 2026 15:06:36 +0200 Subject: [PATCH 1/2] jeedom::update() argument should be an array, not an empty string --- core/api/jeeApi.php | 4 ++-- core/api/proApi.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) 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'); } From dc277c1a0eed046de2164f999acdd0548a5f0e17 Mon Sep 17 00:00:00 2001 From: Mips2648 Date: Mon, 18 May 2026 15:07:31 +0200 Subject: [PATCH 2/2] Refactor: not need to count before foreach --- core/class/jeedom.class.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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 &';