mirror of
https://github.com/PaperMC/Paper.git
synced 2025-02-03 13:27:23 +01:00
Specify charset explicitly on getBytes
This commit is contained in:
parent
6ae3681d8c
commit
2e07e37d99
1 changed files with 1 additions and 1 deletions
|
@ -39,7 +39,7 @@ index 3427e95e60..462ab49762 100644
|
|||
+ long byteAllowed = maxBookPageSize;
|
||||
+ for (int i = 0; i < pageList.size(); ++i) {
|
||||
+ String testString = pageList.getString(i);
|
||||
+ int byteLength = testString.getBytes().length;
|
||||
+ int byteLength = testString.getBytes(java.nio.charset.StandardCharsets.UTF_8).length;
|
||||
+ byteTotal += byteLength;
|
||||
+ if (byteTotal > byteAllowed) {
|
||||
+ PlayerConnection.LOGGER.warn(this.player.getName() + " tried to send too large of a book. Book Size: " + byteTotal + " - Allowed: "+ byteAllowed + " - Pages: " + pageList.size());
|
||||
|
|
Loading…
Add table
Reference in a new issue