Skip to content

Commit

Permalink
enforce string value for safety
Browse files Browse the repository at this point in the history
  • Loading branch information
Seldaek committed Oct 27, 2023
1 parent ed80d53 commit 531ed6d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Monolog/Formatter/NormalizerFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ protected function normalize($data, int $depth = 0)
$value = $data->jsonSerialize();
} elseif (\get_class($data) === '__PHP_Incomplete_Class') {
$accessor = new \ArrayObject($data);
$value = $accessor['__PHP_Incomplete_Class_Name'];
$value = (string) $accessor['__PHP_Incomplete_Class_Name'];
} elseif (method_exists($data, '__toString')) {
/** @var string $value */
$value = $data->__toString();
Expand Down

0 comments on commit 531ed6d

Please sign in to comment.