diff --git a/src/ConfigurationUrlParser.php b/src/ConfigurationUrlParser.php index 48e8b9b..60ac8e4 100644 --- a/src/ConfigurationUrlParser.php +++ b/src/ConfigurationUrlParser.php @@ -13,6 +13,7 @@ use Hyperf\Collection\Arr; use InvalidArgumentException; +use JsonException; class ConfigurationUrlParser { @@ -159,10 +160,9 @@ protected function parseStringsToNativeTypes(mixed $value): mixed return $value; } - $parsedValue = json_decode($value, true); - - if (json_last_error() === JSON_ERROR_NONE) { - return $parsedValue; + try { + return json_decode($value, true, 512, JSON_THROW_ON_ERROR); + } catch (JsonException $e) { } return $value;