]> git.lizzy.rs Git - minetest.git/commitdiff
Server: Ignore whitespace-only chat messages
authorSmallJoker <mk939@ymail.com>
Mon, 21 Jun 2021 17:04:25 +0000 (19:04 +0200)
committerSmallJoker <mk939@ymail.com>
Tue, 22 Jun 2021 17:47:18 +0000 (19:47 +0200)
src/server.cpp

index a8d45278308b940a5336f0602e0336f861d7bd90..c47596a97b7e079f8dfb1670706ec942ae400c41 100644 (file)
@@ -3001,6 +3001,9 @@ std::wstring Server::handleChat(const std::string &name,
        }
 
        auto message = trim(wide_to_utf8(wmessage));
+       if (message.empty())
+               return L"";
+
        if (message.find_first_of("\n\r") != std::wstring::npos) {
                return L"Newlines are not permitted in chat messages";
        }