feat: add error flags for json_decode

Signed-off-by: Jana Peper <jana.peper@nextcloud.com>
pull/49727/head
Jana Peper 1 year ago committed by janepie
parent 8042a82c64
commit d87302c651
  1. 2
      apps/settings/lib/Settings/Admin/ArtificialIntelligence.php
  2. 2
      lib/private/TaskProcessing/Manager.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':

@ -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);
}
/**

Loading…
Cancel
Save