mirror of
https://github.com/XRPLF/rippled.git
synced 2026-04-29 15:37:57 +00:00
Fixes minor chat client issues
This commit is contained in:
@@ -104,8 +104,19 @@ void chat_server_handler::on_message(session_ptr client,const std::string &msg)
|
||||
alias = msg.substr(7);
|
||||
}
|
||||
|
||||
// store alias
|
||||
response = m_connections[client] + " is now known as "+alias;
|
||||
|
||||
// store alias pre-escaped so we don't have to do this replacing every time this
|
||||
// user sends a message
|
||||
|
||||
// escape JSON characters
|
||||
boost::algorithm::replace_all(alias,"\\","\\\\");
|
||||
boost::algorithm::replace_all(alias,"\"","\\\"");
|
||||
|
||||
// escape HTML characters
|
||||
boost::algorithm::replace_all(alias,"&","&");
|
||||
boost::algorithm::replace_all(alias,"<","<");
|
||||
boost::algorithm::replace_all(alias,">",">");
|
||||
|
||||
m_connections[client] = alias;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user