Skip to content

Commit

Permalink
Server: Ignore whitespace-only chat messages
Browse files Browse the repository at this point in the history
  • Loading branch information
SmallJoker committed Jun 22, 2021
1 parent b5c09ad commit a8b7c8f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/server.cpp
Expand Up @@ -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";
}
Expand Down

0 comments on commit a8b7c8f

Please sign in to comment.