Skip to content
Permalink
Browse files
Server: Ignore whitespace-only chat messages
  • Loading branch information
SmallJoker committed Jun 22, 2021
1 parent b5c09ad commit a8b7c8ff38d305f1cde045564779e287adfca98b
Showing with 3 additions and 0 deletions.
  1. +3 −0 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";
}

0 comments on commit a8b7c8f

Please sign in to comment.