From b496a9a80538139037bfc22cee517f856a5b5685 Mon Sep 17 00:00:00 2001 From: Sam Date: Fri, 26 Apr 2024 17:02:55 +0100 Subject: [PATCH] fix: server status error if motd format contains string instead of array (#3502) --- core/classes/Minecraft/MCQuery.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/classes/Minecraft/MCQuery.php b/core/classes/Minecraft/MCQuery.php index 4fdc7b9dfa..644a974fd8 100644 --- a/core/classes/Minecraft/MCQuery.php +++ b/core/classes/Minecraft/MCQuery.php @@ -377,6 +377,10 @@ private static function getMotd(string $text, array $modern_format): string $motd = ''; foreach ($modern_format as $word) { + if (!is_array($word)) { + continue; + } + $motd .= self::COLOUR_CHAR . 'r'; if (isset($word['color'])) { $motd .= self::getColor($word['color']);