Skip to content

Commit

Permalink
feat: add error flags for json_decode
Browse files Browse the repository at this point in the history
Signed-off-by: Jana Peper <[email protected]>
  • Loading branch information
janepie committed Dec 12, 2024
1 parent 608fee3 commit 99c0960
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ public function getForm() {
$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':
Expand Down
2 changes: 1 addition & 1 deletion lib/private/TaskProcessing/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,7 @@ private function _getTaskTypeSettings(): array {
if ($json === '') {
return [];
}
return json_decode($json, true);
return json_decode($json, true, flags: JSON_THROW_ON_ERROR);
}

/**
Expand Down

0 comments on commit 99c0960

Please sign in to comment.