diff --git a/php/src/Data/ConfigurationManager.php b/php/src/Data/ConfigurationManager.php index f23cfcda..c72e1641 100644 --- a/php/src/Data/ConfigurationManager.php +++ b/php/src/Data/ConfigurationManager.php @@ -12,7 +12,7 @@ class ConfigurationManager if(file_exists(DataConst::GetConfigFile())) { $configContent = file_get_contents(DataConst::GetConfigFile()); - return json_decode($configContent, true); + return json_decode($configContent, true, 512, JSON_THROW_ON_ERROR); } return []; @@ -514,7 +514,7 @@ class ConfigurationManager throw new InvalidSettingConfigurationException(DataConst::GetDataDirectory() . " does not exist! Something was set up falsely!"); } $df = disk_free_space(DataConst::GetDataDirectory()); - $content = json_encode($config, JSON_UNESCAPED_SLASHES|JSON_PRETTY_PRINT); + $content = json_encode($config, JSON_UNESCAPED_SLASHES|JSON_PRETTY_PRINT|JSON_THROW_ON_ERROR); $size = strlen($content) + 10240; if ($df !== false && (int)$df < $size) { throw new InvalidSettingConfigurationException(DataConst::GetDataDirectory() . " does not have enough space for writing the config file! Not writing it back!");