From 76d6b30fdfbd03fcb038470a36349b0c11837cfa Mon Sep 17 00:00:00 2001 From: a6a2f5842 Date: Fri, 3 Oct 2025 08:10:16 +0200 Subject: [PATCH] BF prevent bool beeing sent --- src/Websocket/MockConnection.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Websocket/MockConnection.php b/src/Websocket/MockConnection.php index af18c3f..ac40cdd 100644 --- a/src/Websocket/MockConnection.php +++ b/src/Websocket/MockConnection.php @@ -59,6 +59,11 @@ class MockConnection extends Connection implements \Ratchet\ConnectionInterface return $this; } + // if data is boolean, throw + if (is_bool($data)) { + throw new \InvalidArgumentException('Data must be a string or an object that can be converted to a string.'); + } + Log::channel('websocket')->info('[MockConnection] Send for pid: ' . getmypid(), [ 'data' => $data, ]);