diff --git a/.github/workflows/main-php-matrix.yml b/.github/workflows/main-php-matrix.yml index 846459748f4..b81ac8b460c 100644 --- a/.github/workflows/main-php-matrix.yml +++ b/.github/workflows/main-php-matrix.yml @@ -30,7 +30,7 @@ jobs: - uses: actions/checkout@v4 - name: Setup PHP - uses: pmmp/setup-php-action@3.0.0 + uses: pmmp/setup-php-action@3.1.0 with: php-version: ${{ inputs.php }} install-path: "./bin" @@ -62,7 +62,7 @@ jobs: - uses: actions/checkout@v4 - name: Setup PHP - uses: pmmp/setup-php-action@3.0.0 + uses: pmmp/setup-php-action@3.1.0 with: php-version: ${{ inputs.php }} install-path: "./bin" @@ -96,7 +96,7 @@ jobs: submodules: true - name: Setup PHP - uses: pmmp/setup-php-action@3.0.0 + uses: pmmp/setup-php-action@3.1.0 with: php-version: ${{ inputs.php }} install-path: "./bin" @@ -128,7 +128,7 @@ jobs: - uses: actions/checkout@v4 - name: Setup PHP - uses: pmmp/setup-php-action@3.0.0 + uses: pmmp/setup-php-action@3.1.0 with: php-version: ${{ inputs.php }} install-path: "./bin" diff --git a/changelogs/5.11.md b/changelogs/5.11.md index 96c05bf1b6c..e993dceec13 100644 --- a/changelogs/5.11.md +++ b/changelogs/5.11.md @@ -37,3 +37,9 @@ Released 23rd February 2024. ## Internals - Updated GitHub Actions versions to get rid of deprecation warnings. + +# 5.11.2 +Released 26th February 2024. + +## Fixes +- Added extra checks for `BookEditPacket` handling. diff --git a/src/VersionInfo.php b/src/VersionInfo.php index 52fecb633d6..946e53a2328 100644 --- a/src/VersionInfo.php +++ b/src/VersionInfo.php @@ -31,7 +31,7 @@ final class VersionInfo{ public const NAME = "PocketMine-MP"; - public const BASE_VERSION = "5.11.2"; + public const BASE_VERSION = "5.11.3"; public const IS_DEVELOPMENT_BUILD = true; public const BUILD_CHANNEL = "stable"; diff --git a/src/network/mcpe/handler/InGamePacketHandler.php b/src/network/mcpe/handler/InGamePacketHandler.php index 870d8acb828..d01c17c7637 100644 --- a/src/network/mcpe/handler/InGamePacketHandler.php +++ b/src/network/mcpe/handler/InGamePacketHandler.php @@ -877,8 +877,12 @@ private function checkBookText(string $string, string $fieldName, int $softLimit } public function handleBookEdit(BookEditPacket $packet) : bool{ + $inventory = $this->player->getInventory(); + if(!$inventory->slotExists($packet->inventorySlot)){ + return false; + } //TODO: break this up into book API things - $oldBook = $this->player->getInventory()->getItem($packet->inventorySlot); + $oldBook = $inventory->getItem($packet->inventorySlot); if(!($oldBook instanceof WritableBook)){ return false; }