diff options
author | SmallJoker <mk939@ymail.com> | 2021-06-21 19:04:25 +0200 |
---|---|---|
committer | SmallJoker <mk939@ymail.com> | 2021-06-22 19:47:18 +0200 |
commit | a8b7c8ff38d305f1cde045564779e287adfca98b (patch) | |
tree | 6db0f071c4af893f146c640839a45841fc951943 /src/server.cpp | |
parent | b5c09ada79e3fe7b28b48ddb13d5d66989cc6c6c (diff) | |
download | minetest-a8b7c8ff38d305f1cde045564779e287adfca98b.tar.gz minetest-a8b7c8ff38d305f1cde045564779e287adfca98b.tar.bz2 minetest-a8b7c8ff38d305f1cde045564779e287adfca98b.zip |
Server: Ignore whitespace-only chat messages
Diffstat (limited to 'src/server.cpp')
-rw-r--r-- | src/server.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/server.cpp b/src/server.cpp index a8d452783..c47596a97 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -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"; } |