diff --git a/Protocol/Rfc6455.php b/Protocol/Rfc6455.php index 13994e3..79ce5b7 100644 --- a/Protocol/Rfc6455.php +++ b/Protocol/Rfc6455.php @@ -317,8 +317,8 @@ public function send( $end = true, $mask = false ) { - if ((Websocket\Connection::OPCODE_TEXT_FRAME === $opcode || - Websocket\Connection::OPCODE_CONTINUATION_FRAME === $opcode) && + if (Websocket\Connection::OPCODE_TEXT_FRAME === $opcode && + true === $end && false === (bool) preg_match('//u', $message)) { throw new Websocket\Exception\InvalidMessage( 'Message ā€œ%sā€ is not in UTF-8, cannot send it.',