From 3b68655d35f775c69613d7b71c5ed1d404aa531b Mon Sep 17 00:00:00 2001 From: Michal Borychowski <807297+boryn@users.noreply.github.com> Date: Fri, 19 Jul 2024 15:39:01 +0200 Subject: [PATCH] Pass context array key as string at validate0101() --- src/Gelf/MessageValidator.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Gelf/MessageValidator.php b/src/Gelf/MessageValidator.php index 87bee46..dbefe8f 100644 --- a/src/Gelf/MessageValidator.php +++ b/src/Gelf/MessageValidator.php @@ -82,7 +82,7 @@ public function validate0101(MessageInterface $message, ?string &$reason = null) } foreach ($message->getAllAdditionals() as $key => $value) { - if (!preg_match('#^[\w\.\-]*$#', $key)) { + if (!preg_match('#^[\w\.\-]*$#', (string)$key)) { $reason = sprintf( "additional key '%s' contains invalid characters", $key