From 38d75f3aabde1a97c1b0730674788c25b420c4a9 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Sun, 22 May 2022 16:46:53 +0100 Subject: [PATCH 1/2] Player: Be more explicit about not parsing chat messages when messageCounter is zero the length check technically accounts for this, but future readers might not realize this --- src/player/Player.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/player/Player.php b/src/player/Player.php index 7b896ab3a..0415109c2 100644 --- a/src/player/Player.php +++ b/src/player/Player.php @@ -1377,6 +1377,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){ From 9a5a03ef83e2d211df22e3ce89137c2c5dced38e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 24 May 2022 13:46:09 +0100 Subject: [PATCH 2/2] Bump phpstan/phpstan from 1.6.8 to 1.7.1 (#5067) Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan) from 1.6.8 to 1.7.1. - [Release notes](https://github.com/phpstan/phpstan/releases) - [Changelog](https://github.com/phpstan/phpstan/blob/1.7.x/CHANGELOG.md) - [Commits](https://github.com/phpstan/phpstan/compare/1.6.8...1.7.1) --- updated-dependencies: - dependency-name: phpstan/phpstan dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- composer.json | 2 +- composer.lock | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/composer.json b/composer.json index a8ab49aa5..672b41f09 100644 --- a/composer.json +++ b/composer.json @@ -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" diff --git a/composer.lock b/composer.lock index c72f25538..281b655dc 100644 --- a/composer.lock +++ b/composer.lock @@ -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": "ee1b984b67a25ec7c84aeacdc948b367", + "content-hash": "f0d0723913043e45e2831bf5da26b46f", "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",