Merge branch 'stable' into next-minor

This commit is contained in:
Dylan K. Taylor 2022-05-24 14:17:53 +01:00
commit 812d5c3f58
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D
3 changed files with 13 additions and 8 deletions

View File

@ -53,7 +53,7 @@
"webmozart/path-util": "^2.3"
},
"require-dev": {
"phpstan/phpstan": "1.6.8",
"phpstan/phpstan": "1.7.1",
"phpstan/phpstan-phpunit": "^1.1.0",
"phpstan/phpstan-strict-rules": "^1.2.0",
"phpunit/phpunit": "^9.2"

14
composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "9f5181578edb8f8424435a213ea2535e",
"content-hash": "940fa92ddd657ea8f093234660bf7be5",
"packages": [
{
"name": "adhocore/json-comment",
@ -1819,16 +1819,16 @@
},
{
"name": "phpstan/phpstan",
"version": "1.6.8",
"version": "1.7.1",
"source": {
"type": "git",
"url": "https://github.com/phpstan/phpstan.git",
"reference": "d76498c5531232cb8386ceb6004f7e013138d3ba"
"reference": "e3baed2ee2ef322e0f9b8fe8f87fdbe024c7c719"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/d76498c5531232cb8386ceb6004f7e013138d3ba",
"reference": "d76498c5531232cb8386ceb6004f7e013138d3ba",
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/e3baed2ee2ef322e0f9b8fe8f87fdbe024c7c719",
"reference": "e3baed2ee2ef322e0f9b8fe8f87fdbe024c7c719",
"shasum": ""
},
"require": {
@ -1854,7 +1854,7 @@
"description": "PHPStan - PHP Static Analysis Tool",
"support": {
"issues": "https://github.com/phpstan/phpstan/issues",
"source": "https://github.com/phpstan/phpstan/tree/1.6.8"
"source": "https://github.com/phpstan/phpstan/tree/1.7.1"
},
"funding": [
{
@ -1874,7 +1874,7 @@
"type": "tidelift"
}
],
"time": "2022-05-10T06:54:21+00:00"
"time": "2022-05-24T09:05:09+00:00"
},
{
"name": "phpstan/phpstan-phpunit",

View File

@ -1380,6 +1380,11 @@ class Player extends Human implements CommandSender, ChunkListener, IPlayer{
public function chat(string $message) : bool{
$this->removeCurrentWindow();
if($this->messageCounter <= 0){
//the check below would take care of this (0 * (maxlen + 1) = 0), but it's better be explicit
return false;
}
//Fast length check, to make sure we don't get hung trying to explode MBs of string ...
$maxTotalLength = $this->messageCounter * (self::MAX_CHAT_BYTE_LENGTH + 1);
if(strlen($message) > $maxTotalLength){