diff options
author | Jana Peper <jana.peper@nextcloud.com> | 2024-12-12 15:47:01 +0100 |
---|---|---|
committer | janepie <49834966+janepie@users.noreply.github.com> | 2024-12-18 18:32:34 +0100 |
commit | d87302c651dfb18d80856c07d7a16e9c97d68bb0 (patch) | |
tree | d5d91157e3cd1dc7031ad87e5774d2f8eace4e38 | |
parent | 8042a82c64e6e73467f0f943fdadde97c837edc3 (diff) | |
download | nextcloud-server-d87302c651dfb18d80856c07d7a16e9c97d68bb0.tar.gz nextcloud-server-d87302c651dfb18d80856c07d7a16e9c97d68bb0.zip |
feat: add error flags for json_decode
Signed-off-by: Jana Peper <jana.peper@nextcloud.com>
-rw-r--r-- | apps/settings/lib/Settings/Admin/ArtificialIntelligence.php | 2 | ||||
-rw-r--r-- | lib/private/TaskProcessing/Manager.php | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/apps/settings/lib/Settings/Admin/ArtificialIntelligence.php b/apps/settings/lib/Settings/Admin/ArtificialIntelligence.php index c6069635367..a7e5276762d 100644 --- a/apps/settings/lib/Settings/Admin/ArtificialIntelligence.php +++ b/apps/settings/lib/Settings/Admin/ArtificialIntelligence.php @@ -143,7 +143,7 @@ class ArtificialIntelligence implements IDelegatedSettings { $value = $defaultValue; $json = $this->config->getAppValue('core', $key, ''); if ($json !== '') { - $value = json_decode($json, true); + $value = json_decode($json, true, flags: JSON_THROW_ON_ERROR); switch ($key) { case 'ai.taskprocessing_provider_preferences': case 'ai.taskprocessing_type_preferences': diff --git a/lib/private/TaskProcessing/Manager.php b/lib/private/TaskProcessing/Manager.php index e263195d35e..8afc62a05d4 100644 --- a/lib/private/TaskProcessing/Manager.php +++ b/lib/private/TaskProcessing/Manager.php @@ -572,7 +572,7 @@ class Manager implements IManager { if ($json === '') { return []; } - return json_decode($json, true); + return json_decode($json, true, flags: JSON_THROW_ON_ERROR); } /** |