From efca0f83989aedac7dcdcc574d6143e3e21ea494 Mon Sep 17 00:00:00 2001 From: GameHerobrine Date: Mon, 20 Feb 2023 11:29:01 +0300 Subject: [PATCH] fix npe11(send message to yourself) & nc168 --- src/API/ChatAPI.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/API/ChatAPI.php b/src/API/ChatAPI.php index cf7f8272..9f2bfac3 100644 --- a/src/API/ChatAPI.php +++ b/src/API/ChatAPI.php @@ -72,8 +72,13 @@ class ChatAPI{ $target = strtolower($n); if($target === "server" or $target === "console" or $target === "rcon"){ $target = "Console"; + }else{ + return "The player is offline."; } } + if(strtolower($target) === strtolower($issuer)){ + return "You can't send message to yourself."; + } $mes = implode(" ", $params); $output .= "You're whispering to " . $target . ": " . $mes . "\n"; if($target !== "Console" and $target !== "Rcon"){