summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSmallJoker <mk939@ymail.com>2021-06-21 19:04:25 +0200
committerSmallJoker <mk939@ymail.com>2021-06-22 19:47:18 +0200
commita8b7c8ff38d305f1cde045564779e287adfca98b (patch)
tree6db0f071c4af893f146c640839a45841fc951943 /src
parentb5c09ada79e3fe7b28b48ddb13d5d66989cc6c6c (diff)
downloadminetest-a8b7c8ff38d305f1cde045564779e287adfca98b.tar.gz
minetest-a8b7c8ff38d305f1cde045564779e287adfca98b.tar.bz2
minetest-a8b7c8ff38d305f1cde045564779e287adfca98b.zip
Server: Ignore whitespace-only chat messages
Diffstat (limited to 'src')
-rw-r--r--src/server.cpp3
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";
}