diff --git a/src/Format/Json.php b/src/Format/Json.php index 2e67261f..fd46d4f5 100644 --- a/src/Format/Json.php +++ b/src/Format/Json.php @@ -59,6 +59,12 @@ public function stringToObject($data, array $options = array('processSections' = { $data = trim($data); + // Because developers are clearly not validating their data before pushing it into a Registry, we'll do it for them + if (empty($data)) + { + return new \stdClass; + } + if ($data !== '' && $data[0] !== '{') { return AbstractRegistryFormat::getInstance('Ini')->stringToObject($data, $options);