1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-07-31 18:30:15 +02:00

enforce string value for safety

This commit is contained in:
Jordi Boggiano
2023-10-27 14:14:00 +02:00
parent ed80d53ab2
commit 531ed6d873

View File

@@ -176,7 +176,7 @@ class NormalizerFormatter implements FormatterInterface
$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();