Skip to content

Commit

Permalink
update: 限制 e2e-id 长度
Browse files Browse the repository at this point in the history
  • Loading branch information
NHZEX committed Jun 10, 2024
1 parent b0226fc commit 6ec43e8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Server.php
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ private function broadcast(string $clientId, string $message, bool $isCompress,
}
if ($e2eId !== null) {
$_f |= self::FLAG_USE_E2E_ID;
$message = self::BIN_MSG_HEADER . pack('nC', $_f, strlen($e2eId)) . $e2eId . $message;
$message = self::BIN_MSG_HEADER . pack('nC', $_f, strlen($e2eId)) . substr($e2eId, 0, 127) . $message;
} else {
$message = self::BIN_MSG_HEADER . pack('n', $_f) . $message;
}
Expand Down

0 comments on commit 6ec43e8

Please sign in to comment.